From 39d605c1c12bec0f3291513c380baf8caec97184 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 29 Apr 2018 15:52:07 +0200 Subject: [PATCH] Fix async/await support for latest nightly After https://github.com/rust-lang/rust/pull/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. --- futures-macro-async/src/lib.rs | 8 ++++---- futures/tests/async_await_tests.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/futures-macro-async/src/lib.rs b/futures-macro-async/src/lib.rs index b88a23c1c3..f9dfc5ad24 100644 --- a/futures-macro-async/src/lib.rs +++ b/futures-macro-async/src/lib.rs @@ -525,8 +525,8 @@ if_nightly! { impl synom::Synom for AsyncArgs { named!(parse -> Self, map!( - option!(parens!(call!(Punctuated::::parse_separated_nonempty))), - |p| AsyncArgs(p.map(|d| d.1.into_iter().collect()).unwrap_or_default()) + option!(call!(Punctuated::::parse_separated_nonempty)), + |p| AsyncArgs(p.map(|d| d.into_iter().collect()).unwrap_or_default()) )); } @@ -546,8 +546,8 @@ if_nightly! { impl synom::Synom for AsyncStreamArgs { named!(parse -> Self, map!( - option!(parens!(call!(Punctuated::::parse_separated_nonempty))), - |p| AsyncStreamArgs(p.map(|d| d.1.into_iter().collect()).unwrap_or_default()) + option!(call!(Punctuated::::parse_separated_nonempty)), + |p| AsyncStreamArgs(p.map(|d| d.into_iter().collect()).unwrap_or_default()) )); } } diff --git a/futures/tests/async_await_tests.rs b/futures/tests/async_await_tests.rs index 5d27629f39..56c610604e 100644 --- a/futures/tests/async_await_tests.rs +++ b/futures/tests/async_await_tests.rs @@ -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;