diff --git a/futures-async-macro/Cargo.toml b/futures-async-macro/Cargo.toml index c235eca059..c2a54e4a93 100644 --- a/futures-async-macro/Cargo.toml +++ b/futures-async-macro/Cargo.toml @@ -21,4 +21,4 @@ std = [] [dependencies] proc-macro2 = "0.4" quote = "0.6" -syn = { version = "0.15.31", features = ["full", "fold"] } +syn = { version = "0.15.34", features = ["full", "fold"] } diff --git a/futures-async-macro/src/lib.rs b/futures-async-macro/src/lib.rs index 2d6eeb73d3..108a202c84 100644 --- a/futures-async-macro/src/lib.rs +++ b/futures-async-macro/src/lib.rs @@ -10,8 +10,8 @@ use proc_macro2::{Span, TokenStream as TokenStream2, TokenTree as TokenTree2}; use quote::{quote, ToTokens}; use syn::{ fold::{self, Fold}, - token, ArgCaptured, Error, Expr, ExprForLoop, ExprMacro, ExprYield, FnArg, FnDecl, Ident, Item, - ItemFn, Pat, PatIdent, ReturnType, TypeTuple, + token, ArgCaptured, Error, Expr, ExprCall, ExprForLoop, ExprMacro, ExprYield, FnArg, FnDecl, + Ident, Item, ItemFn, Pat, PatIdent, ReturnType, TypeTuple, }; #[macro_use] @@ -298,14 +298,9 @@ impl Expand { if self.0 == Stream && expr.mac.path.is_ident("await") { return self.expand_await_macros(expr); } else if expr.mac.path.is_ident("async_stream_block") { - // FIXME: When added Parse impl for ExprCall, replace `if let ..` + `unreachable!()` - // with `let` + `.unwrap()` - if let Ok(Expr::Call(mut e)) = syn::parse(async_stream_block(expr.mac.tts.into())) { - e.attrs.append(&mut expr.attrs); - return Expr::Call(e); - } else { - unreachable!() - } + let mut e: ExprCall = syn::parse(async_stream_block(expr.mac.tts.into())).unwrap(); + e.attrs.append(&mut expr.attrs); + return Expr::Call(e); } Expr::Macro(expr) diff --git a/futures-select-macro/Cargo.toml b/futures-select-macro/Cargo.toml index 1e3c8c2203..e4542d71e6 100644 --- a/futures-select-macro/Cargo.toml +++ b/futures-select-macro/Cargo.toml @@ -22,4 +22,4 @@ std = [] proc-macro2 = "0.4" proc-macro-hack = "0.5.3" quote = "0.6" -syn = { version = "0.15.31", features = ["full"] } +syn = { version = "0.15.34", features = ["full"] }