diff options
| author | est31 <MTest31@outlook.com> | 2018-04-22 13:34:42 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2018-04-23 11:17:59 +0200 |
| commit | 40f2ca2c95f374ceeb13169af77db9d17901c001 (patch) | |
| tree | fd9afc5dca6462f01f4a540dd72d920fa3efe46f /src/libsyntax/parse | |
| parent | 9af69fe2320bde44b96d85d316a95083fb65c4b8 (diff) | |
| download | rust-40f2ca2c95f374ceeb13169af77db9d17901c001.tar.gz rust-40f2ca2c95f374ceeb13169af77db9d17901c001.zip | |
'label can start expressions
let foo = 'label: loop { break 'label 42; };
is valid Rust code.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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 @@ impl Token { 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, |
