Skip to content

Commit 40f2ca2

Browse files
committed
'label can start expressions
let foo = 'label: loop { break 'label 42; }; is valid Rust code.
1 parent 9af69fe commit 40f2ca2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libsyntax/parse/token.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ impl Token {
277277
DotDot | DotDotDot | DotDotEq | // range notation
278278
Lt | BinOp(Shl) | // associated path
279279
ModSep | // global path
280+
Lifetime(..) | // labeled loop
280281
Pound => true, // expression attributes
281282
Interpolated(ref nt) => match nt.0 {
282-
NtIdent(..) | NtExpr(..) | NtBlock(..) | NtPath(..) => true,
283+
NtIdent(..) | NtExpr(..) | NtBlock(..) | NtPath(..) | NtLifetime(..) => true,
283284
_ => false,
284285
},
285286
_ => false,

0 commit comments

Comments
 (0)