Skip to content

Commit 170a6ee

Browse files
dtolnaytaiki-e
authored andcommitted
Parse rhs of select! arms using match-arm rules
1 parent 59c13c6 commit 170a6ee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

futures-macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ proc-macro = true
1818
[dependencies]
1919
proc-macro2 = "1.0.60"
2020
quote = "1.0"
21-
syn = { version = "2.0.8", features = ["full"] }
21+
syn = { version = "2.0.52", features = ["full"] }
2222

2323
[lints]
2424
workspace = true

futures-macro/src/select.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl Parse for Select {
5959

6060
// `=> <expr>`
6161
input.parse::<Token![=>]>()?;
62-
let expr = input.parse::<Expr>()?;
62+
let expr = Expr::parse_with_earlier_boundary_rule(input)?;
6363

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

0 commit comments

Comments
 (0)