Skip to content

Commit 6236ee1

Browse files
committed
add -Z continue-parse-after-error to parse-fail tests
The new handling fixed a latent bug in the parser error handling where it would only abort after the second error (when configured to stop after the first error). This is because the check for `error_count != 0` was occuring before the increment. Since the increment is tied to the `emit()` call now this no longer occurs.
1 parent ad46ad6 commit 6236ee1

12 files changed

+15
-13
lines changed

src/test/parse-fail/associated-types-project-from-hrtb-explicit.rs

Lines changed: 1 addition & 1 deletion
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
// Test you can't use a higher-ranked trait bound inside of a qualified
1414
// path (just won't parse).

src/test/parse-fail/generic-non-trailing-defaults.rs

Lines changed: 1 addition & 1 deletion
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
struct Heap;
1414

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

Lines changed: 1 addition & 1 deletion
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
struct Baz<U> where U: Eq(U); //This is parsed as the new Fn* style parenthesis syntax.
1414
struct Baz<U> where U: Eq(U) -> R; // Notice this parses as well.

src/test/parse-fail/lex-bad-octal-literal.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 parse-only -Z continue-parse-after-error
12+
1113
fn main() {
1214
0o18; //~ ERROR invalid digit for a base 8 literal
1315
0o1234_9_5670; //~ ERROR invalid digit for a base 8 literal

src/test/parse-fail/lifetime-no-keyword.rs

Lines changed: 1 addition & 1 deletion
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 foo<'a>(a: &'a isize) { }
1414
fn bar(a: &'static isize) { }

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
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
pub fn main() {
15-
br"é"; //~ raw byte string must be ASCII
16-
br##~"a"~##; //~ only `#` is allowed in raw string delimitation
15+
br"é"; //~ ERROR raw byte string must be ASCII
16+
br##~"a"~##; //~ ERROR only `#` is allowed in raw string delimitation
1717
}

src/test/parse-fail/removed-syntax-field-let.rs

Lines changed: 1 addition & 1 deletion
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
struct s {
1414
let foo: (),

src/test/parse-fail/syntax-trait-polarity.rs

Lines changed: 1 addition & 1 deletion
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
#![feature(optin_builtin_traits)]
1414

src/test/parse-fail/trailing-plus-in-bounds.rs

Lines changed: 1 addition & 1 deletion
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
use std::fmt::Debug;
1414

src/test/parse-fail/trait-bounds-not-on-impl.rs

Lines changed: 1 addition & 1 deletion
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 Foo {
1414
}

src/test/parse-fail/use-as-where-use-ends-with-mod-sep.rs

Lines changed: 1 addition & 1 deletion
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
use std::any:: as foo; //~ ERROR expected identifier, found keyword `as`
1414
//~^ ERROR: expected one of `::`, `;`, or `as`, found `foo`

src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs

Lines changed: 1 addition & 1 deletion
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 equal1<T>(_: &T, _: &T) -> bool where {
1414
//~^ ERROR a `where` clause must have at least one predicate in it

0 commit comments

Comments
 (0)