Skip to content

Commit 625bba3

Browse files
committed
fix compile-fail and parse-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 e175000 commit 625bba3

21 files changed

+31
-11
lines changed

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

+2
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

+2
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

+2
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

+2
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

+2
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

+2
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

+2
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

+2
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

src/test/parse-fail/ascii-only-character-escape.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212

1313
fn main() {
1414
let x = "\x80"; //~ ERROR may only be used

src/test/parse-fail/bad-char-literals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212

1313
// ignore-tidy-cr
1414
// ignore-tidy-tab

src/test/parse-fail/bad-lit-suffixes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212

1313

1414
extern

src/test/parse-fail/byte-literals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212

1313

1414
// ignore-tidy-tab

src/test/parse-fail/byte-string-literals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212

1313

1414
// ignore-tidy-tab

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212

1313

1414
trait Serializable<'self, T> { //~ ERROR no longer a special lifetime

src/test/parse-fail/issue-23620-invalid-escapes.rs

+2
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 parse-only -Z continue-parse-after-error
12+
1113
fn main() {
1214
let _ = b"\u{a66e}";
1315
//~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string

src/test/parse-fail/lex-bad-binary-literal.rs

+2
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 parse-only -Z continue-parse-after-error
12+
1113
fn main() {
1214
0b121; //~ ERROR invalid digit for a base 2 literal
1315
0b10_10301; //~ ERROR invalid digit for a base 2 literal

src/test/parse-fail/lex-bad-char-literals-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212
static c3: char =
1313
'\x1' //~ ERROR: numeric character escape is too short
1414
;

src/test/parse-fail/lex-bad-numeric-literals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212

1313
fn main() {
1414
0o1.0; //~ ERROR: octal float literal is not supported

src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212

1313
// ignore-tidy-cr
1414

src/test/parse-fail/new-unicode-escapes-4.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212

1313
pub fn main() {
1414
let s = "\u{lol}";

src/test/parse-fail/no-unsafe-self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212

1313
trait A {
1414
fn foo(*mut self); //~ ERROR cannot pass self by raw pointer

0 commit comments

Comments
 (0)