mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 09:44:08 +00:00
Revert to correct recovery behavior
This commit is contained in:
parent
4e2d1b9466
commit
0e93b75d27
@ -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,
|
||||
|
@ -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() {}
|
||||
|
@ -10,4 +10,4 @@
|
||||
|
||||
fn main() {
|
||||
let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
|
||||
} //~ ERROR expected item, found `}`
|
||||
}
|
||||
|
@ -10,4 +10,4 @@
|
||||
|
||||
fn main() {
|
||||
let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
|
||||
} //~ ERROR expected item, found `}`
|
||||
}
|
||||
|
@ -12,4 +12,4 @@
|
||||
|
||||
fn main() {
|
||||
let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=`
|
||||
} //~ ERROR expected item, found `}`
|
||||
}
|
||||
|
@ -12,4 +12,4 @@
|
||||
|
||||
fn main() {
|
||||
let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!`
|
||||
} //~ ERROR expected item, found `}`
|
||||
}
|
||||
|
@ -12,4 +12,4 @@
|
||||
|
||||
fn main() {
|
||||
let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+`
|
||||
} //~ ERROR expected item, found `}`
|
||||
}
|
||||
|
@ -13,4 +13,4 @@
|
||||
fn main() {
|
||||
let 10 - 3 ..= 10 = 8;
|
||||
//~^ error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-`
|
||||
} //~ ERROR expected item, found `}`
|
||||
}
|
||||
|
@ -15,4 +15,4 @@
|
||||
pub fn main() {
|
||||
let r = 1..2..3;
|
||||
//~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
|
||||
} //~ ERROR expected item, found `}`
|
||||
}
|
||||
|
@ -15,4 +15,4 @@
|
||||
pub fn main() {
|
||||
let r = ..1..2;
|
||||
//~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
|
||||
} //~ ERROR expected item, found `}`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user