-
Notifications
You must be signed in to change notification settings - Fork 13.5k
tests: Do not use -Z parse-only
, continue compilation to test recovery
#57379
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
fn main () { | ||
((1, (2, 3)).1).1; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
fn main () { | ||
(1, (2, 3)).1.1; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
fn that_odd_parse() { | ||
fn main() { | ||
// see assoc-oddities-1 for explanation | ||
x..if c { a } else { b }[n]; //~ ERROR expected one of | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
#[path =] //~ ERROR unexpected token: `]` | ||
mod m {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
#[path() token] //~ ERROR expected `]`, found `token` | ||
mod m {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// compile-flags: -Z parse-only | ||
fn main() {} | ||
|
||
#[derive(Debug)] //~ERROR expected item after attributes |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
// error-pattern:expected statement | ||
|
||
fn f() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
// error-pattern:expected item | ||
|
||
fn main() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
#![feature(lang_items)] | ||
|
||
fn main() {} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,4 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
// error-pattern: expected | ||
|
||
fn main() { | ||
let isize x = 5; | ||
let isize x = 5; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `x` | ||
match x; | ||
} | ||
|
||
fn main() { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
error: expected one of `:`, `;`, `=`, or `@`, found `x` | ||
--> $DIR/bad-match.rs:6:13 | ||
--> $DIR/bad-match.rs:2:13 | ||
| | ||
LL | let isize x = 5; | ||
LL | let isize x = 5; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `x` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For future reference, I prefer to have the error comments just outside of view of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, indeed. let isize x = 5;
//~^ ERROR expected one of `:`, `;`, `=`, or `@`, found `x` ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's usually what I do. I only deviate from that when the line below would somehow still be part of the diagnostic, where I add as many There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We need |
||
| ^ expected one of `:`, `;`, `=`, or `@` here | ||
|
||
error: aborting due to previous error | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
// error-pattern: expected | ||
|
||
fn main() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
fn foo(_: *()) { | ||
//~^ expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) | ||
} | ||
|
||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
fn false() { } //~ ERROR expected identifier, found keyword `false` | ||
fn main() { } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
fn true() { } //~ ERROR expected identifier, found keyword `true` | ||
fn main() { } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
fn main() { | ||
let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3` | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
fn main() { | ||
struct Foo { x: isize } | ||
match (Foo { x: 10 }) { | ||
Foo { ref x: ref x } => {}, //~ ERROR expected `,` | ||
//~| ERROR pattern does not mention field `x` | ||
_ => {} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
error: expected `,` | ||
--> $DIR/bind-struct-early-modifiers.rs:6:19 | ||
--> $DIR/bind-struct-early-modifiers.rs:4:19 | ||
| | ||
LL | Foo { ref x: ref x } => {}, //~ ERROR expected `,` | ||
| ^ | ||
|
||
error: aborting due to previous error | ||
error[E0027]: pattern does not mention field `x` | ||
--> $DIR/bind-struct-early-modifiers.rs:4:9 | ||
| | ||
LL | Foo { ref x: ref x } => {}, //~ ERROR expected `,` | ||
| ^^^^^^^^^^^^^^^^^^^^ missing field `x` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CC #57361. |
||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0027`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
fn f<T: ?>() {} //~ ERROR expected identifier, found `>` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
type A = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b` | ||
|
||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
type A = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+` | ||
|
||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-flags: -Z parse-only | ||
|
||
type A where 'a; //~ ERROR expected `:`, found `;` | ||
|
||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// compile-pass | ||
// compile-flags: -Z parse-only | ||
|
||
type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318) | ||
type A = Box<(Fn(u8) -> u8) + 'static + Send + Sync>; // OK (but see #39318) | ||
|
||
fn main() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this an intentional change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, test
ui/parser/underscore_static.rs
uncovered an unnecessary feature-gate error after removing-Z parse-only
, so this change fixed it.