diff options
| author | bors <bors@rust-lang.org> | 2017-02-14 22:46:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-02-14 22:46:10 +0000 |
| commit | e8154a092558d79f13d7dd48abbfcc4e9d4ed44c (patch) | |
| tree | 67f41f99c8d4adae5b9c5c82bbf2c9824709bb6d /src/libsyntax/parse | |
| parent | 48bc08247a7b4a5579437df54ca3f4a3fb25ce8d (diff) | |
| parent | 4a919cba5b41ff1b8885dfebe5f246fe409e8004 (diff) | |
| download | rust-e8154a092558d79f13d7dd48abbfcc4e9d4ed44c.tar.gz rust-e8154a092558d79f13d7dd48abbfcc4e9d4ed44c.zip | |
Auto merge of #39818 - frewsxcv:rollup, r=frewsxcv
Rollup of 8 pull requests - Successful merges: #39659, #39730, #39754, #39772, #39785, #39788, #39790, #39813 - Failed merges:
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b051928ff9d..2c4fa8e15ed 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -302,11 +302,20 @@ impl<'a> Parser<'a> { if i + 1 < tts.len() { self.tts.push((tts, i + 1)); } - if let TokenTree::Token(sp, tok) = tt { - TokenAndSpan { tok: tok, sp: sp } - } else { - self.tts.push((tt, 0)); - continue + // FIXME(jseyfried): remove after fixing #39390 in #39419. + if self.quote_depth > 0 { + if let TokenTree::Sequence(sp, _) = tt { + self.span_err(sp, "attempted to repeat an expression containing no \ + syntax variables matched as repeating at this depth"); + } + } + match tt { + TokenTree::Token(sp, tok) => TokenAndSpan { tok: tok, sp: sp }, + _ if tt.len() > 0 => { + self.tts.push((tt, 0)); + continue + } + _ => continue, } } else { TokenAndSpan { tok: token::Eof, sp: self.span } |
