Skip to content

Commit

Permalink
Parse rhs of select! arms using match-arm rules
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay authored and taiki-e committed Mar 3, 2024
1 parent 59c13c6 commit 170a6ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion futures-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1.0.60"
quote = "1.0"
syn = { version = "2.0.8", features = ["full"] }
syn = { version = "2.0.52", features = ["full"] }

[lints]
workspace = true
4 changes: 2 additions & 2 deletions futures-macro/src/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Parse for Select {

// `=> <expr>`
input.parse::<Token![=>]>()?;
let expr = input.parse::<Expr>()?;
let expr = Expr::parse_with_earlier_boundary_rule(input)?;

// Commas after the expression are only optional if it's a `Block`
// or it is the last branch in the `match`.
Expand Down Expand Up @@ -229,7 +229,7 @@ fn select_inner(input: TokenStream, random: bool) -> TokenStream {
let branches = parsed.normal_fut_handlers.into_iter().zip(variant_names.iter()).map(
|((pat, expr), variant_name)| {
quote! {
#enum_ident::#variant_name(#pat) => { #expr },
#enum_ident::#variant_name(#pat) => #expr,
}
},
);
Expand Down

0 comments on commit 170a6ee

Please sign in to comment.