Skip to content

Commit 828a8df

Browse files
nggcramertj
authored andcommitted
Fix async/await support for latest nightly
After rust-lang/rust#50120 procedural macros do not receive the parentheses as part of their attributes TokenStream. Also the proc_macro_non_items feature is necessary to use async_block.
1 parent 1a52eba commit 828a8df

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

futures-macro-async/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,8 @@ if_nightly! {
525525

526526
impl synom::Synom for AsyncArgs {
527527
named!(parse -> Self, map!(
528-
option!(parens!(call!(Punctuated::<AsyncArg, syn::token::Comma>::parse_separated_nonempty))),
529-
|p| AsyncArgs(p.map(|d| d.1.into_iter().collect()).unwrap_or_default())
528+
call!(Punctuated::<AsyncArg, syn::token::Comma>::parse_separated),
529+
|p| AsyncArgs(p.into_iter().collect())
530530
));
531531
}
532532

@@ -546,8 +546,8 @@ if_nightly! {
546546

547547
impl synom::Synom for AsyncStreamArgs {
548548
named!(parse -> Self, map!(
549-
option!(parens!(call!(Punctuated::<AsyncStreamArg, syn::token::Comma>::parse_separated_nonempty))),
550-
|p| AsyncStreamArgs(p.map(|d| d.1.into_iter().collect()).unwrap_or_default())
549+
call!(Punctuated::<AsyncStreamArg, syn::token::Comma>::parse_separated),
550+
|p| AsyncStreamArgs(p.into_iter().collect())
551551
));
552552
}
553553
}

futures/testcrate/ui/move-captured-variable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(proc_macro, generators, pin)]
1+
#![feature(proc_macro, proc_macro_non_items, generators, pin)]
22

33
extern crate futures;
44

futures/tests/async_await_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(feature = "nightly", feature(proc_macro, generators, pin))]
1+
#![cfg_attr(feature = "nightly", feature(proc_macro, proc_macro_non_items, generators, pin))]
22

33
extern crate futures;
44

0 commit comments

Comments
 (0)