Skip to content

Commit f9d74d0

Browse files
committed
fix compile-fail tests by blindly opting back into parser recovery (so
that expected errors match up) I'm opting into parser recovery in all these cases out of expediency, not because the error messages you get with recovery enabled are actually all that usable in all cases listed.
1 parent 26dae32 commit f9d74d0

File tree

8 files changed

+16
-0
lines changed

8 files changed

+16
-0
lines changed

src/test/compile-fail/issue-12560-2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z continue-parse-after-error
12+
1113
// For style and consistency reasons, non-parametrized enum variants must
1214
// be used simply as `ident` instead of `ident ()`.
1315
// This test-case covers enum matching.

src/test/compile-fail/issue-28433.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z continue-parse-after-error
12+
1113
enum bird {
1214
pub duck,
1315
//~^ ERROR: expected identifier, found keyword `pub`

src/test/compile-fail/issue-30715.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z continue-parse-after-error
12+
1113
macro_rules! parallel {
1214
(
1315
// If future has `pred`/`moelarry` fragments (where "pred" is

src/test/compile-fail/macro-incomplete-parse.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z continue-parse-after-error
12+
1113
macro_rules! ignored_item {
1214
() => {
1315
fn foo() {}

src/test/compile-fail/parse-error-correct.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z continue-parse-after-error
12+
1113
// Test that the parser is error correcting missing idents. Despite a parsing
1214
// error (or two), we still run type checking (and don't get extra errors there).
1315

src/test/compile-fail/parser-recovery-1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z continue-parse-after-error
12+
1113
// Test that we can recover from missing braces in the parser.
1214

1315
trait Foo {

src/test/compile-fail/parser-recovery-2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z continue-parse-after-error
12+
1113
// Test that we can recover from mismatched braces in the parser.
1214

1315
trait Foo {

src/test/compile-fail/self_type_keyword.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z continue-parse-after-error
12+
1113
struct Self;
1214
//~^ ERROR expected identifier, found keyword `Self`
1315

0 commit comments

Comments
 (0)