1
Fork 0

tests: Do not use -Z parse-only, continue compilation to test recovery

This commit is contained in:
Vadim Petrochenkov 2019-01-06 18:33:05 +03:00
parent 6b2c311718
commit 1f64f60d5c
530 changed files with 753 additions and 886 deletions

View file

@ -16,8 +16,6 @@ import stat
template = """ template = """
// compile-flags: -Z parse-only
// This file was auto-generated using 'src/etc/generate-keyword-tests.py %s' // This file was auto-generated using 'src/etc/generate-keyword-tests.py %s'
fn main() { fn main() {

View file

@ -1543,7 +1543,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
fn visit_item(&mut self, i: &'a ast::Item) { fn visit_item(&mut self, i: &'a ast::Item) {
match i.node { match i.node {
ast::ItemKind::Static(..) |
ast::ItemKind::Const(_,_) => { ast::ItemKind::Const(_,_) => {
if i.ident.name == "_" { if i.ident.name == "_" {
gate_feature_post!(&self, underscore_const_names, i.span, gate_feature_post!(&self, underscore_const_names, i.span,

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
fn main () { fn main () {
((1, (2, 3)).1).1; ((1, (2, 3)).1).1;
} }

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
fn main () { fn main () {
(1, (2, 3)).1.1; (1, (2, 3)).1.1;
} }

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` found at both mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` found at both
fn main() { fn main() {

View file

@ -1,5 +1,5 @@
error[E0584]: file for module `mod_file_disambig_aux` found at both mod_file_disambig_aux.rs and mod_file_disambig_aux/mod.rs error[E0584]: file for module `mod_file_disambig_aux` found at both mod_file_disambig_aux.rs and mod_file_disambig_aux/mod.rs
--> $DIR/mod_file_disambig.rs:3:5 --> $DIR/mod_file_disambig.rs:1:5
| |
LL | mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` found at both LL | mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` found at both
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
fn main() { fn main() {
let mut ref x = 10; //~ ERROR the order of `mut` and `ref` is incorrect let mut ref x = 10; //~ ERROR the order of `mut` and `ref` is incorrect
let ref mut y = 11; let ref mut y = 11;

View file

@ -1,5 +1,5 @@
error: the order of `mut` and `ref` is incorrect error: the order of `mut` and `ref` is incorrect
--> $DIR/mut-ref.rs:4:9 --> $DIR/mut-ref.rs:2:9
| |
LL | let mut ref x = 10; //~ ERROR the order of `mut` and `ref` is incorrect LL | let mut ref x = 10; //~ ERROR the order of `mut` and `ref` is incorrect
| ^^^^^^^ help: try switching the order: `ref mut` | ^^^^^^^ help: try switching the order: `ref mut`

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
fn main() { fn main() {
let x = "\x80"; //~ ERROR may only be used let x = "\x80"; //~ ERROR may only be used

View file

@ -1,6 +1,6 @@
// compile-flags: -Z parse-only // compile-flags: -Z parse-only
fn that_odd_parse() { fn main() {
// following lines below parse and must not fail // following lines below parse and must not fail
x = if c { a } else { b }(); x = if c { a } else { b }();
x = if true { 1 } else { 0 } as *mut _; x = if true { 1 } else { 0 } as *mut _;

View file

@ -1,6 +1,6 @@
// compile-flags: -Z parse-only // compile-flags: -Z parse-only
fn that_odd_parse() { fn main() {
// see assoc-oddities-1 for explanation // see assoc-oddities-1 for explanation
x..if c { a } else { b }[n]; //~ ERROR expected one of x..if c { a } else { b }[n]; //~ ERROR expected one of
} }

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
// Test you can't use a higher-ranked trait bound inside of a qualified // Test you can't use a higher-ranked trait bound inside of a qualified
// path (just won't parse). // path (just won't parse).

View file

@ -1,4 +1,2 @@
// compile-flags: -Z parse-only
#[path =] //~ ERROR unexpected token: `]` #[path =] //~ ERROR unexpected token: `]`
mod m {} mod m {}

View file

@ -1,5 +1,5 @@
error: unexpected token: `]` error: unexpected token: `]`
--> $DIR/attr-bad-meta-2.rs:3:9 --> $DIR/attr-bad-meta-2.rs:1:9
| |
LL | #[path =] //~ ERROR unexpected token: `]` LL | #[path =] //~ ERROR unexpected token: `]`
| ^ unexpected token after this | ^ unexpected token after this

View file

@ -1,4 +1,2 @@
// compile-flags: -Z parse-only
#[path() token] //~ ERROR expected `]`, found `token` #[path() token] //~ ERROR expected `]`, found `token`
mod m {} mod m {}

View file

@ -1,5 +1,5 @@
error: expected `]`, found `token` error: expected `]`, found `token`
--> $DIR/attr-bad-meta-3.rs:3:10 --> $DIR/attr-bad-meta-3.rs:1:10
| |
LL | #[path() token] //~ ERROR expected `]`, found `token` LL | #[path() token] //~ ERROR expected `]`, found `token`
| ^^^^^ expected `]` | ^^^^^ expected `]`

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
#![feature(unrestricted_attribute_tokens)] #![feature(unrestricted_attribute_tokens)]
#[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*` #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`

View file

@ -1,5 +1,5 @@
error: expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*` error: expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
--> $DIR/attr-bad-meta.rs:5:7 --> $DIR/attr-bad-meta.rs:3:7
| |
LL | #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*` LL | #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
| ^ expected one of `(`, `::`, `=`, `[`, `]`, or `{` here | ^ expected one of `(`, `::`, `=`, `[`, `]`, or `{` here

View file

@ -1,3 +1,3 @@
// compile-flags: -Z parse-only fn main() {}
#[derive(Debug)] //~ERROR expected item after attributes #[derive(Debug)] //~ERROR expected item after attributes

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
// error-pattern:expected statement // error-pattern:expected statement
fn f() { fn f() {

View file

@ -1,5 +1,5 @@
error: expected statement after outer attribute error: expected statement after outer attribute
--> $DIR/attr-dangling-in-fn.rs:7:1 --> $DIR/attr-dangling-in-fn.rs:5:1
| |
LL | } LL | }
| ^ | ^

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
// error-pattern:expected item // error-pattern:expected item
fn main() { fn main() {

View file

@ -1,5 +1,5 @@
error: expected item after attributes error: expected item after attributes
--> $DIR/attr-dangling-in-mod.rs:8:14 --> $DIR/attr-dangling-in-mod.rs:6:14
| |
LL | #[foo = "bar"] LL | #[foo = "bar"]
| ^ | ^

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
#![feature(lang_items)] #![feature(lang_items)]
fn main() {} fn main() {}

View file

@ -1,5 +1,5 @@
error: an inner attribute is not permitted in this context error: an inner attribute is not permitted in this context
--> $DIR/attr.rs:7:3 --> $DIR/attr.rs:5:3
| |
LL | #![lang(foo)] //~ ERROR an inner attribute is not permitted in this context LL | #![lang(foo)] //~ ERROR an inner attribute is not permitted in this context
| ^ | ^

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
// Constants (static variables) can be used to match in patterns, but mutable // Constants (static variables) can be used to match in patterns, but mutable
// statics cannot. This ensures that there's some form of error if this is // statics cannot. This ensures that there's some form of error if this is
// attempted. // attempted.

View file

@ -1,5 +1,5 @@
error: expected item after attributes error: expected item after attributes
--> $DIR/attrs-after-extern-mod.rs:12:19 --> $DIR/attrs-after-extern-mod.rs:10:19
| |
LL | #[cfg(stage37)] //~ ERROR expected item after attributes LL | #[cfg(stage37)] //~ ERROR expected item after attributes
| ^ | ^

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
// ignore-tidy-cr // ignore-tidy-cr
// ignore-tidy-tab // ignore-tidy-tab

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
extern extern

View file

@ -1,11 +1,4 @@
// compile-flags: -Z parse-only
// error-pattern: expected
fn main() { fn main() {
let isize x = 5; let isize x = 5; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `x`
match x; match x;
} }
fn main() {
}

View file

@ -1,7 +1,7 @@
error: expected one of `:`, `;`, `=`, or `@`, found `x` 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`
| ^ expected one of `:`, `;`, `=`, or `@` here | ^ expected one of `:`, `;`, `=`, or `@` here
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
// error-pattern: expected // error-pattern: expected
fn main() { fn main() {

View file

@ -1,5 +1,5 @@
error: expected one of `:`, `;`, `=`, or `@`, found `.` error: expected one of `:`, `;`, `=`, or `@`, found `.`
--> $DIR/bad-name.rs:6:8 --> $DIR/bad-name.rs:4:8
| |
LL | let x.y::<isize>.z foo; LL | let x.y::<isize>.z foo;
| ^ expected one of `:`, `;`, `=`, or `@` here | ^ expected one of `:`, `;`, `=`, or `@` here

View file

@ -1,5 +1,5 @@
// compile-flags: -Z parse-only
fn foo(_: *()) { fn foo(_: *()) {
//~^ expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) //~^ expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)
} }
fn main() {}

View file

@ -1,5 +1,5 @@
error: expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) error: expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)
--> $DIR/bad-pointer-type.rs:3:11 --> $DIR/bad-pointer-type.rs:1:11
| |
LL | fn foo(_: *()) { LL | fn foo(_: *()) {
| ^ | ^

View file

@ -1,4 +1,2 @@
// compile-flags: -Z parse-only
fn false() { } //~ ERROR expected identifier, found keyword `false` fn false() { } //~ ERROR expected identifier, found keyword `false`
fn main() { } fn main() { }

View file

@ -1,5 +1,5 @@
error: expected identifier, found keyword `false` error: expected identifier, found keyword `false`
--> $DIR/bad-value-ident-false.rs:3:4 --> $DIR/bad-value-ident-false.rs:1:4
| |
LL | fn false() { } //~ ERROR expected identifier, found keyword `false` LL | fn false() { } //~ ERROR expected identifier, found keyword `false`
| ^^^^^ expected identifier, found keyword | ^^^^^ expected identifier, found keyword

View file

@ -1,4 +1,2 @@
// compile-flags: -Z parse-only
fn true() { } //~ ERROR expected identifier, found keyword `true` fn true() { } //~ ERROR expected identifier, found keyword `true`
fn main() { } fn main() { }

View file

@ -1,5 +1,5 @@
error: expected identifier, found keyword `true` error: expected identifier, found keyword `true`
--> $DIR/bad-value-ident-true.rs:3:4 --> $DIR/bad-value-ident-true.rs:1:4
| |
LL | fn true() { } //~ ERROR expected identifier, found keyword `true` LL | fn true() { } //~ ERROR expected identifier, found keyword `true`
| ^^^^ expected identifier, found keyword | ^^^^ expected identifier, found keyword

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
fn main() { fn main() {
let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3` let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
} }

View file

@ -1,5 +1,5 @@
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3` error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
--> $DIR/better-expected.rs:4:19 --> $DIR/better-expected.rs:2:19
| |
LL | let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3` LL | let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
| - ^ expected one of 7 possible tokens here | - ^ expected one of 7 possible tokens here

View file

@ -1,9 +1,8 @@
// compile-flags: -Z parse-only
fn main() { fn main() {
struct Foo { x: isize } struct Foo { x: isize }
match (Foo { x: 10 }) { match (Foo { x: 10 }) {
Foo { ref x: ref x } => {}, //~ ERROR expected `,` Foo { ref x: ref x } => {}, //~ ERROR expected `,`
//~| ERROR pattern does not mention field `x`
_ => {} _ => {}
} }
} }

View file

@ -1,8 +1,15 @@
error: expected `,` 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 `,` 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`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0027`.

View file

@ -1,3 +1 @@
// compile-flags: -Z parse-only
fn f<T: ?>() {} //~ ERROR expected identifier, found `>` fn f<T: ?>() {} //~ ERROR expected identifier, found `>`

View file

@ -1,5 +1,5 @@
error: expected identifier, found `>` error: expected identifier, found `>`
--> $DIR/bound-single-question-mark.rs:3:10 --> $DIR/bound-single-question-mark.rs:1:10
| |
LL | fn f<T: ?>() {} //~ ERROR expected identifier, found `>` LL | fn f<T: ?>() {} //~ ERROR expected identifier, found `>`
| ^ expected identifier | ^ expected identifier

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
type A = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b` type A = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b`
fn main() {} fn main() {}

View file

@ -1,5 +1,5 @@
error: expected one of `,`, `:`, or `>`, found `'b` error: expected one of `,`, `:`, or `>`, found `'b`
--> $DIR/bounds-lifetime-1.rs:3:17 --> $DIR/bounds-lifetime-1.rs:1:17
| |
LL | type A = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b` LL | type A = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b`
| ^^ expected one of `,`, `:`, or `>` here | ^^ expected one of `,`, `:`, or `>` here

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
type A = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+` type A = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+`
fn main() {} fn main() {}

View file

@ -1,5 +1,5 @@
error: expected one of `,`, `:`, or `>`, found `+` error: expected one of `,`, `:`, or `>`, found `+`
--> $DIR/bounds-lifetime-2.rs:3:17 --> $DIR/bounds-lifetime-2.rs:1:17
| |
LL | type A = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+` LL | type A = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+`
| ^ expected one of `,`, `:`, or `>` here | ^ expected one of `,`, `:`, or `>` here

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
type A where 'a; //~ ERROR expected `:`, found `;` type A where 'a; //~ ERROR expected `:`, found `;`
fn main() {} fn main() {}

View file

@ -1,5 +1,5 @@
error: expected `:`, found `;` error: expected `:`, found `;`
--> $DIR/bounds-lifetime-where-1.rs:3:16 --> $DIR/bounds-lifetime-where-1.rs:1:16
| |
LL | type A where 'a; //~ ERROR expected `:`, found `;` LL | type A where 'a; //~ ERROR expected `:`, found `;`
| ^ expected `:` | ^ expected `:`

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
type A where 'a: 'b + 'c = u8; // OK type A where 'a: 'b + 'c = u8; // OK
type A where 'a: 'b, = u8; // OK type A where 'a: 'b, = u8; // OK
type A where 'a: = u8; // OK type A where 'a: = u8; // OK

View file

@ -1,5 +1,5 @@
error: expected one of `=`, lifetime, or type, found `,` error: expected one of `=`, lifetime, or type, found `,`
--> $DIR/bounds-lifetime-where.rs:10:14 --> $DIR/bounds-lifetime-where.rs:8:14
| |
LL | type A where , = u8; //~ ERROR expected one of `=`, lifetime, or type, found `,` LL | type A where , = u8; //~ ERROR expected one of `=`, lifetime, or type, found `,`
| ^ expected one of `=`, lifetime, or type here | ^ expected one of `=`, lifetime, or type here

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
type A = for<'a:> fn(); // OK type A = for<'a:> fn(); // OK
type A = for<'a:,> fn(); // OK type A = for<'a:,> fn(); // OK
type A = for<'a> fn(); // OK type A = for<'a> fn(); // OK

View file

@ -1,5 +1,5 @@
error: expected one of `>`, identifier, or lifetime, found `,` error: expected one of `>`, identifier, or lifetime, found `,`
--> $DIR/bounds-lifetime.rs:11:14 --> $DIR/bounds-lifetime.rs:9:14
| |
LL | type A = for<,> fn(); //~ ERROR expected one of `>`, identifier, or lifetime, found `,` LL | type A = for<,> fn(); //~ ERROR expected one of `>`, identifier, or lifetime, found `,`
| ^ expected one of `>`, identifier, or lifetime here | ^ expected one of `>`, identifier, or lifetime here

View file

@ -1,4 +1,5 @@
// compile-pass // 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() {}

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
type A where for<'a> for<'b> Trait1 + ?Trait2: 'a + Trait = u8; // OK type A where for<'a> for<'b> Trait1 + ?Trait2: 'a + Trait = u8; // OK
type A where T: Trait, = u8; // OK type A where T: Trait, = u8; // OK
type A where T: = u8; // OK type A where T: = u8; // OK

View file

@ -1,5 +1,5 @@
error: expected one of `!`, `(`, `+`, `::`, `:`, `<`, `==`, or `=`, found `,` error: expected one of `!`, `(`, `+`, `::`, `:`, `<`, `==`, or `=`, found `,`
--> $DIR/bounds-type-where.rs:10:15 --> $DIR/bounds-type-where.rs:8:15
| |
LL | type A where T, = u8; LL | type A where T, = u8;
| ^ expected one of 8 possible tokens here | ^ expected one of 8 possible tokens here

View file

@ -1,7 +1,5 @@
// compile-flags: -Z parse-only fn main() {
match 10 {
fn foo() {
match x {
<T as Trait>::Type{key: value} => (), <T as Trait>::Type{key: value} => (),
//~^ ERROR unexpected `{` after qualified path //~^ ERROR unexpected `{` after qualified path
_ => (), _ => (),

View file

@ -1,5 +1,5 @@
error: unexpected `{` after qualified path error: unexpected `{` after qualified path
--> $DIR/brace-after-qualified-path-in-match.rs:5:27 --> $DIR/brace-after-qualified-path-in-match.rs:3:27
| |
LL | <T as Trait>::Type{key: value} => (), LL | <T as Trait>::Type{key: value} => (),
| ^ unexpected `{` after qualified path | ^ unexpected `{` after qualified path

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
// ignore-tidy-tab // ignore-tidy-tab

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
// ignore-tidy-tab // ignore-tidy-tab

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
// ignore-test: this is an auxiliary file for circular-modules-main.rs // ignore-test: this is an auxiliary file for circular-modules-main.rs
#[path = "circular_modules_main.rs"] #[path = "circular_modules_main.rs"]

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
#[path = "circular_modules_hello.rs"] #[path = "circular_modules_hello.rs"]
mod circular_modules_hello; //~ ERROR: circular modules mod circular_modules_hello; //~ ERROR: circular modules

View file

@ -1,5 +1,5 @@
error: circular modules: $DIR/circular_modules_hello.rs -> $DIR/circular_modules_main.rs -> $DIR/circular_modules_hello.rs error: circular modules: $DIR/circular_modules_hello.rs -> $DIR/circular_modules_main.rs -> $DIR/circular_modules_hello.rs
--> $DIR/circular_modules_main.rs:4:5 --> $DIR/circular_modules_main.rs:2:5
| |
LL | mod circular_modules_hello; //~ ERROR: circular modules LL | mod circular_modules_hello; //~ ERROR: circular modules
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
// error-pattern:nonexistent // error-pattern:nonexistent
class cat : nonexistent { class cat : nonexistent {
let meows: usize; let meows: usize;

View file

@ -1,5 +1,5 @@
error: expected one of `!` or `::`, found `cat` error: expected one of `!` or `::`, found `cat`
--> $DIR/class-implements-bad-trait.rs:4:7 --> $DIR/class-implements-bad-trait.rs:2:7
| |
LL | class cat : nonexistent { LL | class cat : nonexistent {
| ^^^ expected one of `!` or `::` here | ^^^ expected one of `!` or `::` here

View file

@ -1,8 +1,6 @@
// Test that we cannot parse a closure with an explicit return type // Test that we cannot parse a closure with an explicit return type
// unless it uses braces. // unless it uses braces.
// compile-flags: -Z parse-only
fn main() { fn main() {
let x = || -> i32 22; let x = || -> i32 22;
//~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22` //~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`

View file

@ -1,5 +1,5 @@
error: expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22` error: expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`
--> $DIR/closure-return-syntax.rs:7:23 --> $DIR/closure-return-syntax.rs:5:23
| |
LL | let x = || -> i32 22; LL | let x = || -> i32 22;
| ^^ expected one of `!`, `(`, `+`, `::`, `<`, or `{` here | ^^ expected one of `!`, `(`, `+`, `::`, `<`, or `{` here

View file

@ -1,3 +1 @@
// compile-flags: -Z parse-only
# //~ ERROR expected `[`, found `<eof>` # //~ ERROR expected `[`, found `<eof>`

View file

@ -1,5 +1,5 @@
error: expected `[`, found `<eof>` error: expected `[`, found `<eof>`
--> $DIR/column-offset-1-based.rs:3:1 --> $DIR/column-offset-1-based.rs:1:1
| |
LL | # //~ ERROR expected `[`, found `<eof>` LL | # //~ ERROR expected `[`, found `<eof>`
| ^ expected `[` | ^ expected `[`

View file

@ -1,7 +1,7 @@
// compile-flags: -Z parse-only
// Test successful and unsuccessful parsing of the `default` contextual keyword // Test successful and unsuccessful parsing of the `default` contextual keyword
#![feature(specialization)]
trait Foo { trait Foo {
fn foo<T: Default>() -> T; fn foo<T: Default>() -> T;
} }
@ -13,12 +13,12 @@ impl Foo for u8 {
} }
impl Foo for u16 { impl Foo for u16 {
pub default fn foo<T: Default>() -> T { pub default fn foo<T: Default>() -> T { //~ ERROR unnecessary visibility qualifier
T::default() T::default()
} }
} }
impl Foo for u32 { impl Foo for u32 { //~ ERROR not all trait items implemented, missing: `foo`
default pub fn foo<T: Default>() -> T { T::default() } //~ ERROR expected one of default pub fn foo<T: Default>() -> T { T::default() } //~ ERROR expected one of
} }

View file

@ -4,5 +4,22 @@ error: expected one of `async`, `const`, `existential`, `extern`, `fn`, `type`,
LL | default pub fn foo<T: Default>() -> T { T::default() } //~ ERROR expected one of LL | default pub fn foo<T: Default>() -> T { T::default() } //~ ERROR expected one of
| ^^^ expected one of 7 possible tokens here | ^^^ expected one of 7 possible tokens here
error: aborting due to previous error error[E0449]: unnecessary visibility qualifier
--> $DIR/default.rs:16:5
|
LL | pub default fn foo<T: Default>() -> T { //~ ERROR unnecessary visibility qualifier
| ^^^ `pub` not permitted here because it's implied
error[E0046]: not all trait items implemented, missing: `foo`
--> $DIR/default.rs:21:1
|
LL | fn foo<T: Default>() -> T;
| -------------------------- `foo` from trait
...
LL | impl Foo for u32 { //~ ERROR not all trait items implemented, missing: `foo`
| ^^^^^^^^^^^^^^^^ missing `foo` in implementation
error: aborting due to 3 previous errors
Some errors occurred: E0046, E0449.
For more information about an error, try `rustc --explain E0046`.

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
fn main() { fn main() {
let _: Option<()> = do catch {}; let _: Option<()> = do catch {};
//~^ ERROR found removed `do catch` syntax //~^ ERROR found removed `do catch` syntax

View file

@ -1,5 +1,5 @@
error: found removed `do catch` syntax error: found removed `do catch` syntax
--> $DIR/do-catch-suggests-try.rs:4:25 --> $DIR/do-catch-suggests-try.rs:2:25
| |
LL | let _: Option<()> = do catch {}; LL | let _: Option<()> = do catch {};
| ^^ | ^^

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
struct X { struct X {
a: u8 /** document a */, a: u8 /** document a */,

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only fn main() {}
/// hi /// hi
#[derive(Debug)] //~ERROR expected item after attributes #[derive(Debug)] //~ERROR expected item after attributes

View file

@ -1,3 +1,3 @@
// compile-flags: -Z parse-only fn main() {}
/// hi //~ERROR expected item after doc comment /// hi //~ERROR expected item after doc comment

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
extern { extern {
/// hi /// hi
//~^ ERROR expected item after doc comment //~^ ERROR expected item after doc comment

View file

@ -1,5 +1,5 @@
error: expected item after doc comment error: expected item after doc comment
--> $DIR/doc-before-extern-rbrace.rs:4:5 --> $DIR/doc-before-extern-rbrace.rs:2:5
| |
LL | /// hi LL | /// hi
| ^^^^^^ | ^^^^^^

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
fn main() { fn main() {
/// document /// document

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
fn /// document fn /// document
foo() {} foo() {}

View file

@ -1,6 +1,8 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
mod Foo { mod Foo {
/// document /// document
//~^ ERROR expected item after doc comment //~^ ERROR expected item after doc comment
} }
fn main() {}

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
fn main() { fn main() {
println!("Hi"); /// hi println!("Hi"); /// hi
//~^ ERROR found a documentation comment that doesn't document anything //~^ ERROR found a documentation comment that doesn't document anything

View file

@ -1,5 +1,5 @@
error[E0585]: found a documentation comment that doesn't document anything error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-before-rbrace.rs:4:21 --> $DIR/doc-before-rbrace.rs:2:21
| |
LL | println!("Hi"); /// hi LL | println!("Hi"); /// hi
| ^^^^^^ | ^^^^^^

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
fn main() { fn main() {
/// hi /// hi
//~^ ERROR found a documentation comment that doesn't document anything //~^ ERROR found a documentation comment that doesn't document anything

View file

@ -1,5 +1,5 @@
error[E0585]: found a documentation comment that doesn't document anything error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-before-semi.rs:4:5 --> $DIR/doc-before-semi.rs:2:5
| |
LL | /// hi LL | /// hi
| ^^^^^^ | ^^^^^^

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
struct X { struct X {
a: u8, a: u8,

View file

@ -1,4 +1,4 @@
// compile-flags: -Z parse-only -Z continue-parse-after-error // compile-flags: -Z continue-parse-after-error
struct X { struct X {
a: u8 /// document a: u8 /// document

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
// error-pattern:expected one of `(`, `fn`, `static`, or `type` // error-pattern:expected one of `(`, `fn`, `static`, or `type`
extern { extern {
pub pub fn foo(); pub pub fn foo();

View file

@ -1,5 +1,5 @@
error: expected one of `(`, `fn`, `static`, or `type`, found `pub` error: expected one of `(`, `fn`, `static`, or `type`, found `pub`
--> $DIR/duplicate-visibility.rs:5:9 --> $DIR/duplicate-visibility.rs:3:9
| |
LL | pub pub fn foo(); LL | pub pub fn foo();
| ^^^ expected one of `(`, `fn`, `static`, or `type` here | ^^^ expected one of `(`, `fn`, `static`, or `type` here

View file

@ -1,3 +1 @@
// compile-flags: -Z parse-only
impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;` impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`

View file

@ -1,5 +1,5 @@
error: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;` error: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`
--> $DIR/empty-impl-semicolon.rs:3:9 --> $DIR/empty-impl-semicolon.rs:1:9
| |
LL | impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;` LL | impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`
| ^ expected one of 8 possible tokens here | ^ expected one of 8 possible tokens here

View file

@ -1,3 +1 @@
// compile-flags: -Z parse-only
extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte` extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte`

View file

@ -1,5 +1,5 @@
error: expected one of `crate`, `fn`, or `{`, found `crte` error: expected one of `crate`, `fn`, or `{`, found `crte`
--> $DIR/extern-crate-unexpected-token.rs:3:8 --> $DIR/extern-crate-unexpected-token.rs:1:8
| |
LL | extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte` LL | extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte`
| ^^^^ expected one of `crate`, `fn`, or `{` here | ^^^^ expected one of `crate`, `fn`, or `{` here

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
// Verifies that the expected token errors for `extern crate` are // Verifies that the expected token errors for `extern crate` are
// raised // raised

View file

@ -1,5 +1,5 @@
error: expected one of `fn` or `{`, found `mod` error: expected one of `fn` or `{`, found `mod`
--> $DIR/extern-expected-fn-or-brace.rs:6:12 --> $DIR/extern-expected-fn-or-brace.rs:4:12
| |
LL | extern "C" mod foo; //~ERROR expected one of `fn` or `{`, found `mod` LL | extern "C" mod foo; //~ERROR expected one of `fn` or `{`, found `mod`
| ^^^ expected one of `fn` or `{` here | ^^^ expected one of `fn` or `{` here

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
// Verifies that the expected token errors for `extern crate` are // Verifies that the expected token errors for `extern crate` are
// raised // raised

View file

@ -1,5 +1,5 @@
error: expected one of `;` or `as`, found `{` error: expected one of `;` or `as`, found `{`
--> $DIR/extern-foreign-crate.rs:6:18 --> $DIR/extern-foreign-crate.rs:4:18
| |
LL | extern crate foo {} //~ERROR expected one of `;` or `as`, found `{` LL | extern crate foo {} //~ERROR expected one of `;` or `as`, found `{`
| ^ expected one of `;` or `as` here | ^ expected one of `;` or `as` here

View file

@ -1,5 +1,3 @@
// compile-flags: -Z parse-only
extern { //~ ERROR missing `fn`, `type`, or `static` for extern-item declaration extern { //~ ERROR missing `fn`, `type`, or `static` for extern-item declaration
f(); f();
} }

Some files were not shown because too many files have changed in this diff Show more