Skip to content

Commit

Permalink
Fix async/await support for latest nightly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ngg committed Apr 29, 2018
1 parent 1a52eba commit 5099913
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions futures-macro-async/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ if_nightly! {

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

Expand All @@ -546,8 +546,8 @@ if_nightly! {

impl synom::Synom for AsyncStreamArgs {
named!(parse -> Self, map!(
option!(parens!(call!(Punctuated::<AsyncStreamArg, syn::token::Comma>::parse_separated_nonempty))),
|p| AsyncStreamArgs(p.map(|d| d.1.into_iter().collect()).unwrap_or_default())
option!(call!(Punctuated::<AsyncStreamArg, syn::token::Comma>::parse_separated_nonempty)),
|p| AsyncStreamArgs(p.map(|d| d.into_iter().collect()).unwrap_or_default())
));
}
}
2 changes: 1 addition & 1 deletion futures/testcrate/ui/move-captured-variable.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(proc_macro, generators, pin)]
#![feature(proc_macro, proc_macro_non_items, generators, pin)]

extern crate futures;

Expand Down
2 changes: 1 addition & 1 deletion futures/tests/async_await_tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(feature = "nightly", feature(proc_macro, generators, pin))]
#![cfg_attr(feature = "nightly", feature(proc_macro, proc_macro_non_items, generators, pin))]

extern crate futures;

Expand Down

0 comments on commit 5099913

Please sign in to comment.