Skip to content

Commit 0e93b75

Browse files
committed
Revert to correct recovery behavior
1 parent 4e2d1b9 commit 0e93b75

10 files changed

+10
-9
lines changed

src/libsyntax/parse/parser.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4273,6 +4273,7 @@ impl<'a> Parser<'a> {
42734273
Err(mut err) => {
42744274
err.emit();
42754275
self.recover_stmt_(SemiColonMode::Ignore, BlockMode::Break);
4276+
self.eat(&token::CloseDelim(token::Brace));
42764277
break;
42774278
}
42784279
Ok(stmt) => stmt,

src/test/parse-fail/issue-22712.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ struct Foo<B> {
1414

1515
fn bar() {
1616
let Foo<Vec<u8>> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
17-
} //~ ERROR expected item, found `}`
17+
}
1818

1919
fn main() {}

src/test/parse-fail/issue-24197.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

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

src/test/parse-fail/pat-lt-bracket-5.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

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

src/test/parse-fail/pat-ranges-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

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

src/test/parse-fail/pat-ranges-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

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

src/test/parse-fail/pat-ranges-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

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

src/test/parse-fail/pat-ranges-4.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
fn main() {
1414
let 10 - 3 ..= 10 = 8;
1515
//~^ error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-`
16-
} //~ ERROR expected item, found `}`
16+
}

src/test/parse-fail/range-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
pub fn main() {
1616
let r = 1..2..3;
1717
//~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
18-
} //~ ERROR expected item, found `}`
18+
}

src/test/parse-fail/range-4.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
pub fn main() {
1616
let r = ..1..2;
1717
//~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
18-
} //~ ERROR expected item, found `}`
18+
}

0 commit comments

Comments
 (0)