We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b9b70c commit 944c401Copy full SHA for 944c401
src/libsyntax/parse/parser.rs
@@ -4486,6 +4486,11 @@ impl<'a> Parser<'a> {
4486
// Which is valid in other languages, but not Rust.
4487
match self.parse_stmt_without_recovery(false) {
4488
Ok(Some(stmt)) => {
4489
+ if self.look_ahead(1, |t| t == &token::OpenDelim(token::Brace)) {
4490
+ // if the next token is an open brace (e.g., `if a b {`), the place-
4491
+ // inside-a-block suggestion would be more likely wrong than right
4492
+ return Err(e);
4493
+ }
4494
let mut stmt_span = stmt.span;
4495
// expand the span to include the semicolon, if it exists
4496
if self.eat(&token::Semi) {
0 commit comments