1
Fork 0

Revert to correct recovery behavior

This commit is contained in:
Esteban Küber 2017-11-23 13:16:19 -08:00
parent 4e2d1b9466
commit 0e93b75d27
10 changed files with 10 additions and 9 deletions

View file

@ -4273,6 +4273,7 @@ impl<'a> Parser<'a> {
Err(mut err) => { Err(mut err) => {
err.emit(); err.emit();
self.recover_stmt_(SemiColonMode::Ignore, BlockMode::Break); self.recover_stmt_(SemiColonMode::Ignore, BlockMode::Break);
self.eat(&token::CloseDelim(token::Brace));
break; break;
} }
Ok(stmt) => stmt, Ok(stmt) => stmt,

View file

@ -14,6 +14,6 @@ struct Foo<B> {
fn bar() { fn bar() {
let Foo<Vec<u8>> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<` let Foo<Vec<u8>> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
} //~ ERROR expected item, found `}` }
fn main() {} fn main() {}

View file

@ -10,4 +10,4 @@
fn main() { fn main() {
let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[` let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
} //~ ERROR expected item, found `}` }

View file

@ -10,4 +10,4 @@
fn main() { fn main() {
let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[` let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
} //~ ERROR expected item, found `}` }

View file

@ -12,4 +12,4 @@
fn main() { fn main() {
let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=` let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=`
} //~ ERROR expected item, found `}` }

View file

@ -12,4 +12,4 @@
fn main() { fn main() {
let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!` let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!`
} //~ ERROR expected item, found `}` }

View file

@ -12,4 +12,4 @@
fn main() { fn main() {
let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+` let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+`
} //~ ERROR expected item, found `}` }

View file

@ -13,4 +13,4 @@
fn main() { fn main() {
let 10 - 3 ..= 10 = 8; let 10 - 3 ..= 10 = 8;
//~^ error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-` //~^ error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-`
} //~ ERROR expected item, found `}` }

View file

@ -15,4 +15,4 @@
pub fn main() { pub fn main() {
let r = 1..2..3; let r = 1..2..3;
//~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..` //~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
} //~ ERROR expected item, found `}` }

View file

@ -15,4 +15,4 @@
pub fn main() { pub fn main() {
let r = ..1..2; let r = ..1..2;
//~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..` //~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
} //~ ERROR expected item, found `}` }