Merge pull request #3146 from flip1995/fix-3145

Fix 3145
This commit is contained in:
Philipp Krones 2018-09-07 20:30:05 +02:00 committed by GitHub
commit 404dd8245e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View file

@ -284,7 +284,6 @@ fn check_tts<'a>(cx: &EarlyContext<'a>, tts: &ThinTokenStream, is_write: bool) -
let mut idx = 0;
loop {
if !parser.eat(&token::Comma) {
assert!(parser.eat(&token::Eof));
return (Some(fmtstr), expr);
}
let token_expr = match parser.parse_expr().map_err(|mut err| err.cancel()) {

3
tests/ui/issue-3145.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
println!("{}" a); //~ERROR expected token: `,`
}

View file

@ -0,0 +1,8 @@
error: expected token: `,`
--> $DIR/issue-3145.rs:2:19
|
2 | println!("{}" a); //~ERROR expected token: `,`
| ^
error: aborting due to previous error