Skip to content

Commit

Permalink
Update syn dependency to 0.15.34
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed May 9, 2019
1 parent 48773e3 commit 10fc0b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion futures-async-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
15 changes: 5 additions & 10 deletions futures-async-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion futures-select-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }

0 comments on commit 10fc0b0

Please sign in to comment.