From 170a6eeaa9392cf042cc4d9e5ddfcb0a64364258 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 28 Feb 2024 12:07:45 -0800 Subject: [PATCH] Parse rhs of `select!` arms using match-arm rules --- futures-macro/Cargo.toml | 2 +- futures-macro/src/select.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/futures-macro/Cargo.toml b/futures-macro/Cargo.toml index ddd740aa7..c6fe91cd1 100644 --- a/futures-macro/Cargo.toml +++ b/futures-macro/Cargo.toml @@ -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 diff --git a/futures-macro/src/select.rs b/futures-macro/src/select.rs index 4cd8c7bc6..57bb74a84 100644 --- a/futures-macro/src/select.rs +++ b/futures-macro/src/select.rs @@ -59,7 +59,7 @@ impl Parse for Select { // `=> ` input.parse::]>()?; - let expr = input.parse::()?; + 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`. @@ -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, } }, );