From 40f2ca2c95f374ceeb13169af77db9d17901c001 Mon Sep 17 00:00:00 2001 From: est31 Date: Sun, 22 Apr 2018 13:34:42 +0200 Subject: [PATCH] 'label can start expressions let foo = 'label: loop { break 'label 42; }; is valid Rust code. --- src/libsyntax/parse/token.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 44394384c7a..938711ca1d4 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -277,9 +277,10 @@ pub fn can_begin_expr(&self) -> bool { DotDot | DotDotDot | DotDotEq | // range notation Lt | BinOp(Shl) | // associated path ModSep | // global path + Lifetime(..) | // labeled loop Pound => true, // expression attributes Interpolated(ref nt) => match nt.0 { - NtIdent(..) | NtExpr(..) | NtBlock(..) | NtPath(..) => true, + NtIdent(..) | NtExpr(..) | NtBlock(..) | NtPath(..) | NtLifetime(..) => true, _ => false, }, _ => false, -- 2.44.0