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.emit();
self.recover_stmt_(SemiColonMode::Ignore, BlockMode::Break);
self.eat(&token::CloseDelim(token::Brace));
break;
}
Ok(stmt) => stmt,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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