From 96f4f91184095dddadce3803f3bd4eb5d9e433bc Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 28 Dec 2024 10:22:36 -0800 Subject: [PATCH] Fix `break as T` --- src/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expr.rs b/src/expr.rs index a2e47d31b4..67ccc7773e 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -904,7 +904,7 @@ impl Expr { #[cfg(feature = "parsing")] #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] pub fn peek(input: ParseStream) -> bool { - input.peek(Ident::peek_any) // value name or keyword + input.peek(Ident::peek_any) && !input.peek(Token![as]) // value name or keyword || input.peek(token::Paren) // tuple || input.peek(token::Bracket) // array || input.peek(token::Brace) // block