diff --git a/src/etc/generate-keyword-tests.py b/src/etc/generate-keyword-tests.py index 99d11c8178a..9936ce71b76 100755 --- a/src/etc/generate-keyword-tests.py +++ b/src/etc/generate-keyword-tests.py @@ -16,8 +16,6 @@ import stat template = """ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py %s' fn main() { diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 8362c86f8ba..cca2702f1a7 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -1543,7 +1543,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { fn visit_item(&mut self, i: &'a ast::Item) { match i.node { - ast::ItemKind::Static(..) | ast::ItemKind::Const(_,_) => { if i.ident.name == "_" { gate_feature_post!(&self, underscore_const_names, i.span, diff --git a/src/test/rustfix/tuple-float-index.fixed b/src/test/rustfix/tuple-float-index.fixed index abb07962e89..358a27d3878 100644 --- a/src/test/rustfix/tuple-float-index.fixed +++ b/src/test/rustfix/tuple-float-index.fixed @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main () { ((1, (2, 3)).1).1; } diff --git a/src/test/rustfix/tuple-float-index.rs b/src/test/rustfix/tuple-float-index.rs index f3280e87a01..72612252a80 100644 --- a/src/test/rustfix/tuple-float-index.rs +++ b/src/test/rustfix/tuple-float-index.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main () { (1, (2, 3)).1.1; } diff --git a/src/test/ui/mod/mod_file_disambig.rs b/src/test/ui/mod/mod_file_disambig.rs index b7365cd16e9..ef203ef082b 100644 --- a/src/test/ui/mod/mod_file_disambig.rs +++ b/src/test/ui/mod/mod_file_disambig.rs @@ -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 fn main() { diff --git a/src/test/ui/mod/mod_file_disambig.stderr b/src/test/ui/mod/mod_file_disambig.stderr index 3e094733220..1720ca420ca 100644 --- a/src/test/ui/mod/mod_file_disambig.stderr +++ b/src/test/ui/mod/mod_file_disambig.stderr @@ -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 - --> $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 | ^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/mut/mut-ref.rs b/src/test/ui/mut/mut-ref.rs index 064990e52b9..80990b2bfde 100644 --- a/src/test/ui/mut/mut-ref.rs +++ b/src/test/ui/mut/mut-ref.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let mut ref x = 10; //~ ERROR the order of `mut` and `ref` is incorrect let ref mut y = 11; diff --git a/src/test/ui/mut/mut-ref.stderr b/src/test/ui/mut/mut-ref.stderr index a91483aca4a..339da7f8a02 100644 --- a/src/test/ui/mut/mut-ref.stderr +++ b/src/test/ui/mut/mut-ref.stderr @@ -1,5 +1,5 @@ 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 | ^^^^^^^ help: try switching the order: `ref mut` diff --git a/src/test/ui/parser/ascii-only-character-escape.rs b/src/test/ui/parser/ascii-only-character-escape.rs index a644f6239b3..f1b028ea8de 100644 --- a/src/test/ui/parser/ascii-only-character-escape.rs +++ b/src/test/ui/parser/ascii-only-character-escape.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error fn main() { let x = "\x80"; //~ ERROR may only be used diff --git a/src/test/ui/parser/assoc-oddities-1.rs b/src/test/ui/parser/assoc-oddities-1.rs index 7dc3e7237ab..5914805e5c1 100644 --- a/src/test/ui/parser/assoc-oddities-1.rs +++ b/src/test/ui/parser/assoc-oddities-1.rs @@ -1,6 +1,6 @@ // compile-flags: -Z parse-only -fn that_odd_parse() { +fn main() { // following lines below parse and must not fail x = if c { a } else { b }(); x = if true { 1 } else { 0 } as *mut _; diff --git a/src/test/ui/parser/assoc-oddities-2.rs b/src/test/ui/parser/assoc-oddities-2.rs index fe4641b2004..3d35aad7455 100644 --- a/src/test/ui/parser/assoc-oddities-2.rs +++ b/src/test/ui/parser/assoc-oddities-2.rs @@ -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 } diff --git a/src/test/ui/parser/associated-types-project-from-hrtb-explicit.rs b/src/test/ui/parser/associated-types-project-from-hrtb-explicit.rs index aa225be2454..ed9c996d4cc 100644 --- a/src/test/ui/parser/associated-types-project-from-hrtb-explicit.rs +++ b/src/test/ui/parser/associated-types-project-from-hrtb-explicit.rs @@ -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 // path (just won't parse). diff --git a/src/test/ui/parser/attr-bad-meta-2.rs b/src/test/ui/parser/attr-bad-meta-2.rs index b7488d3085a..cefd3369742 100644 --- a/src/test/ui/parser/attr-bad-meta-2.rs +++ b/src/test/ui/parser/attr-bad-meta-2.rs @@ -1,4 +1,2 @@ -// compile-flags: -Z parse-only - #[path =] //~ ERROR unexpected token: `]` mod m {} diff --git a/src/test/ui/parser/attr-bad-meta-2.stderr b/src/test/ui/parser/attr-bad-meta-2.stderr index 1c1c2762e47..ddc7a4b034b 100644 --- a/src/test/ui/parser/attr-bad-meta-2.stderr +++ b/src/test/ui/parser/attr-bad-meta-2.stderr @@ -1,5 +1,5 @@ error: unexpected token: `]` - --> $DIR/attr-bad-meta-2.rs:3:9 + --> $DIR/attr-bad-meta-2.rs:1:9 | LL | #[path =] //~ ERROR unexpected token: `]` | ^ unexpected token after this diff --git a/src/test/ui/parser/attr-bad-meta-3.rs b/src/test/ui/parser/attr-bad-meta-3.rs index c72e9c3fb51..b51e9f2212d 100644 --- a/src/test/ui/parser/attr-bad-meta-3.rs +++ b/src/test/ui/parser/attr-bad-meta-3.rs @@ -1,4 +1,2 @@ -// compile-flags: -Z parse-only - #[path() token] //~ ERROR expected `]`, found `token` mod m {} diff --git a/src/test/ui/parser/attr-bad-meta-3.stderr b/src/test/ui/parser/attr-bad-meta-3.stderr index a31300cd8a0..863a2d2069f 100644 --- a/src/test/ui/parser/attr-bad-meta-3.stderr +++ b/src/test/ui/parser/attr-bad-meta-3.stderr @@ -1,5 +1,5 @@ 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` | ^^^^^ expected `]` diff --git a/src/test/ui/parser/attr-bad-meta.rs b/src/test/ui/parser/attr-bad-meta.rs index 28d5cea05ab..7fe54272491 100644 --- a/src/test/ui/parser/attr-bad-meta.rs +++ b/src/test/ui/parser/attr-bad-meta.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - #![feature(unrestricted_attribute_tokens)] #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*` diff --git a/src/test/ui/parser/attr-bad-meta.stderr b/src/test/ui/parser/attr-bad-meta.stderr index f29c14ab353..7351702ec9d 100644 --- a/src/test/ui/parser/attr-bad-meta.stderr +++ b/src/test/ui/parser/attr-bad-meta.stderr @@ -1,5 +1,5 @@ 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 `*` | ^ expected one of `(`, `::`, `=`, `[`, `]`, or `{` here diff --git a/src/test/ui/parser/attr-before-eof.rs b/src/test/ui/parser/attr-before-eof.rs index c090a77fc30..6af1783e630 100644 --- a/src/test/ui/parser/attr-before-eof.rs +++ b/src/test/ui/parser/attr-before-eof.rs @@ -1,3 +1,3 @@ -// compile-flags: -Z parse-only +fn main() {} #[derive(Debug)] //~ERROR expected item after attributes diff --git a/src/test/ui/parser/attr-dangling-in-fn.rs b/src/test/ui/parser/attr-dangling-in-fn.rs index 79bf4c0695f..c7c45bafb0d 100644 --- a/src/test/ui/parser/attr-dangling-in-fn.rs +++ b/src/test/ui/parser/attr-dangling-in-fn.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern:expected statement fn f() { diff --git a/src/test/ui/parser/attr-dangling-in-fn.stderr b/src/test/ui/parser/attr-dangling-in-fn.stderr index 2fe6c7090d5..71488d2e5c3 100644 --- a/src/test/ui/parser/attr-dangling-in-fn.stderr +++ b/src/test/ui/parser/attr-dangling-in-fn.stderr @@ -1,5 +1,5 @@ error: expected statement after outer attribute - --> $DIR/attr-dangling-in-fn.rs:7:1 + --> $DIR/attr-dangling-in-fn.rs:5:1 | LL | } | ^ diff --git a/src/test/ui/parser/attr-dangling-in-mod.rs b/src/test/ui/parser/attr-dangling-in-mod.rs index ffc6bbc835b..261ed3913af 100644 --- a/src/test/ui/parser/attr-dangling-in-mod.rs +++ b/src/test/ui/parser/attr-dangling-in-mod.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern:expected item fn main() { diff --git a/src/test/ui/parser/attr-dangling-in-mod.stderr b/src/test/ui/parser/attr-dangling-in-mod.stderr index 5f09b05eb7f..d896b61ce49 100644 --- a/src/test/ui/parser/attr-dangling-in-mod.stderr +++ b/src/test/ui/parser/attr-dangling-in-mod.stderr @@ -1,5 +1,5 @@ error: expected item after attributes - --> $DIR/attr-dangling-in-mod.rs:8:14 + --> $DIR/attr-dangling-in-mod.rs:6:14 | LL | #[foo = "bar"] | ^ diff --git a/src/test/ui/parser/attr.rs b/src/test/ui/parser/attr.rs index 9f4ee80285a..041f30cd242 100644 --- a/src/test/ui/parser/attr.rs +++ b/src/test/ui/parser/attr.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - #![feature(lang_items)] fn main() {} diff --git a/src/test/ui/parser/attr.stderr b/src/test/ui/parser/attr.stderr index e66dd7fcd94..44714dc56ee 100644 --- a/src/test/ui/parser/attr.stderr +++ b/src/test/ui/parser/attr.stderr @@ -1,5 +1,5 @@ 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 | ^ diff --git a/src/test/ui/parser/attrs-after-extern-mod.rs b/src/test/ui/parser/attrs-after-extern-mod.rs index 2078320f128..4bdd16471cd 100644 --- a/src/test/ui/parser/attrs-after-extern-mod.rs +++ b/src/test/ui/parser/attrs-after-extern-mod.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // 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 // attempted. diff --git a/src/test/ui/parser/attrs-after-extern-mod.stderr b/src/test/ui/parser/attrs-after-extern-mod.stderr index 7be8f7200a8..067c4192ce6 100644 --- a/src/test/ui/parser/attrs-after-extern-mod.stderr +++ b/src/test/ui/parser/attrs-after-extern-mod.stderr @@ -1,5 +1,5 @@ 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 | ^ diff --git a/src/test/ui/parser/bad-char-literals.rs b/src/test/ui/parser/bad-char-literals.rs index 085f61645fb..1c9b5973be7 100644 --- a/src/test/ui/parser/bad-char-literals.rs +++ b/src/test/ui/parser/bad-char-literals.rs @@ -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-tab diff --git a/src/test/ui/parser/bad-lit-suffixes.rs b/src/test/ui/parser/bad-lit-suffixes.rs index 989d63e2e94..391e7f0acf9 100644 --- a/src/test/ui/parser/bad-lit-suffixes.rs +++ b/src/test/ui/parser/bad-lit-suffixes.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error extern diff --git a/src/test/ui/parser/bad-match.rs b/src/test/ui/parser/bad-match.rs index 32c4beec0e4..79bc7eec311 100644 --- a/src/test/ui/parser/bad-match.rs +++ b/src/test/ui/parser/bad-match.rs @@ -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() { -} diff --git a/src/test/ui/parser/bad-match.stderr b/src/test/ui/parser/bad-match.stderr index 02f7dd67164..dd3a2d2a27a 100644 --- a/src/test/ui/parser/bad-match.stderr +++ b/src/test/ui/parser/bad-match.stderr @@ -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` | ^ expected one of `:`, `;`, `=`, or `@` here error: aborting due to previous error diff --git a/src/test/ui/parser/bad-name.rs b/src/test/ui/parser/bad-name.rs index 3f3e7533ae2..9b42716924d 100644 --- a/src/test/ui/parser/bad-name.rs +++ b/src/test/ui/parser/bad-name.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern: expected fn main() { diff --git a/src/test/ui/parser/bad-name.stderr b/src/test/ui/parser/bad-name.stderr index 847fdabaaf0..15e61cf06ca 100644 --- a/src/test/ui/parser/bad-name.stderr +++ b/src/test/ui/parser/bad-name.stderr @@ -1,5 +1,5 @@ error: expected one of `:`, `;`, `=`, or `@`, found `.` - --> $DIR/bad-name.rs:6:8 + --> $DIR/bad-name.rs:4:8 | LL | let x.y::.z foo; | ^ expected one of `:`, `;`, `=`, or `@` here diff --git a/src/test/ui/parser/bad-pointer-type.rs b/src/test/ui/parser/bad-pointer-type.rs index 7f446542ee0..0e5a01103dc 100644 --- a/src/test/ui/parser/bad-pointer-type.rs +++ b/src/test/ui/parser/bad-pointer-type.rs @@ -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() {} diff --git a/src/test/ui/parser/bad-pointer-type.stderr b/src/test/ui/parser/bad-pointer-type.stderr index 43b01800d6b..860f9f96bb8 100644 --- a/src/test/ui/parser/bad-pointer-type.stderr +++ b/src/test/ui/parser/bad-pointer-type.stderr @@ -1,5 +1,5 @@ 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(_: *()) { | ^ diff --git a/src/test/ui/parser/bad-value-ident-false.rs b/src/test/ui/parser/bad-value-ident-false.rs index 3379ab8bf15..4645ab4a775 100644 --- a/src/test/ui/parser/bad-value-ident-false.rs +++ b/src/test/ui/parser/bad-value-ident-false.rs @@ -1,4 +1,2 @@ -// compile-flags: -Z parse-only - fn false() { } //~ ERROR expected identifier, found keyword `false` fn main() { } diff --git a/src/test/ui/parser/bad-value-ident-false.stderr b/src/test/ui/parser/bad-value-ident-false.stderr index 1a5c982a43d..69a496f3a0c 100644 --- a/src/test/ui/parser/bad-value-ident-false.stderr +++ b/src/test/ui/parser/bad-value-ident-false.stderr @@ -1,5 +1,5 @@ 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` | ^^^^^ expected identifier, found keyword diff --git a/src/test/ui/parser/bad-value-ident-true.rs b/src/test/ui/parser/bad-value-ident-true.rs index 40815abc12f..0f64266d322 100644 --- a/src/test/ui/parser/bad-value-ident-true.rs +++ b/src/test/ui/parser/bad-value-ident-true.rs @@ -1,4 +1,2 @@ -// compile-flags: -Z parse-only - fn true() { } //~ ERROR expected identifier, found keyword `true` fn main() { } diff --git a/src/test/ui/parser/bad-value-ident-true.stderr b/src/test/ui/parser/bad-value-ident-true.stderr index f431706ccd7..2606b7450ae 100644 --- a/src/test/ui/parser/bad-value-ident-true.stderr +++ b/src/test/ui/parser/bad-value-ident-true.stderr @@ -1,5 +1,5 @@ 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` | ^^^^ expected identifier, found keyword diff --git a/src/test/ui/parser/better-expected.rs b/src/test/ui/parser/better-expected.rs index 0a6dca75888..16b61caa4df 100644 --- a/src/test/ui/parser/better-expected.rs +++ b/src/test/ui/parser/better-expected.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3` } diff --git a/src/test/ui/parser/better-expected.stderr b/src/test/ui/parser/better-expected.stderr index 8751a0a2426..3495353c6f9 100644 --- a/src/test/ui/parser/better-expected.stderr +++ b/src/test/ui/parser/better-expected.stderr @@ -1,5 +1,5 @@ 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` | - ^ expected one of 7 possible tokens here diff --git a/src/test/ui/parser/bind-struct-early-modifiers.rs b/src/test/ui/parser/bind-struct-early-modifiers.rs index 945823fdddc..c1de0df54e2 100644 --- a/src/test/ui/parser/bind-struct-early-modifiers.rs +++ b/src/test/ui/parser/bind-struct-early-modifiers.rs @@ -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` _ => {} } } diff --git a/src/test/ui/parser/bind-struct-early-modifiers.stderr b/src/test/ui/parser/bind-struct-early-modifiers.stderr index ab83744013d..618e577e4e2 100644 --- a/src/test/ui/parser/bind-struct-early-modifiers.stderr +++ b/src/test/ui/parser/bind-struct-early-modifiers.stderr @@ -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` +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0027`. diff --git a/src/test/ui/parser/bound-single-question-mark.rs b/src/test/ui/parser/bound-single-question-mark.rs index 0352dc0f6fe..64d702d14bb 100644 --- a/src/test/ui/parser/bound-single-question-mark.rs +++ b/src/test/ui/parser/bound-single-question-mark.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - fn f() {} //~ ERROR expected identifier, found `>` diff --git a/src/test/ui/parser/bound-single-question-mark.stderr b/src/test/ui/parser/bound-single-question-mark.stderr index b2c04c73e09..e30b32f41b4 100644 --- a/src/test/ui/parser/bound-single-question-mark.stderr +++ b/src/test/ui/parser/bound-single-question-mark.stderr @@ -1,5 +1,5 @@ error: expected identifier, found `>` - --> $DIR/bound-single-question-mark.rs:3:10 + --> $DIR/bound-single-question-mark.rs:1:10 | LL | fn f() {} //~ ERROR expected identifier, found `>` | ^ expected identifier diff --git a/src/test/ui/parser/bounds-lifetime-1.rs b/src/test/ui/parser/bounds-lifetime-1.rs index 1e64756a6de..e458f644c9f 100644 --- a/src/test/ui/parser/bounds-lifetime-1.rs +++ b/src/test/ui/parser/bounds-lifetime-1.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - type A = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b` fn main() {} diff --git a/src/test/ui/parser/bounds-lifetime-1.stderr b/src/test/ui/parser/bounds-lifetime-1.stderr index 8fe3bdc407e..33bba35f692 100644 --- a/src/test/ui/parser/bounds-lifetime-1.stderr +++ b/src/test/ui/parser/bounds-lifetime-1.stderr @@ -1,5 +1,5 @@ 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` | ^^ expected one of `,`, `:`, or `>` here diff --git a/src/test/ui/parser/bounds-lifetime-2.rs b/src/test/ui/parser/bounds-lifetime-2.rs index 6d865ffeb24..f184107bbd1 100644 --- a/src/test/ui/parser/bounds-lifetime-2.rs +++ b/src/test/ui/parser/bounds-lifetime-2.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - type A = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+` fn main() {} diff --git a/src/test/ui/parser/bounds-lifetime-2.stderr b/src/test/ui/parser/bounds-lifetime-2.stderr index c287dc4b47b..a8a22aaafce 100644 --- a/src/test/ui/parser/bounds-lifetime-2.stderr +++ b/src/test/ui/parser/bounds-lifetime-2.stderr @@ -1,5 +1,5 @@ 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 `+` | ^ expected one of `,`, `:`, or `>` here diff --git a/src/test/ui/parser/bounds-lifetime-where-1.rs b/src/test/ui/parser/bounds-lifetime-where-1.rs index d0c7c9df26c..f1a002a9f7b 100644 --- a/src/test/ui/parser/bounds-lifetime-where-1.rs +++ b/src/test/ui/parser/bounds-lifetime-where-1.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - type A where 'a; //~ ERROR expected `:`, found `;` fn main() {} diff --git a/src/test/ui/parser/bounds-lifetime-where-1.stderr b/src/test/ui/parser/bounds-lifetime-where-1.stderr index 6f8373f2d27..0300fe98910 100644 --- a/src/test/ui/parser/bounds-lifetime-where-1.stderr +++ b/src/test/ui/parser/bounds-lifetime-where-1.stderr @@ -1,5 +1,5 @@ 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 `;` | ^ expected `:` diff --git a/src/test/ui/parser/bounds-lifetime-where.rs b/src/test/ui/parser/bounds-lifetime-where.rs index 532bf53d61f..acb04e7859b 100644 --- a/src/test/ui/parser/bounds-lifetime-where.rs +++ b/src/test/ui/parser/bounds-lifetime-where.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - type A where 'a: 'b + 'c = u8; // OK type A where 'a: 'b, = u8; // OK type A where 'a: = u8; // OK diff --git a/src/test/ui/parser/bounds-lifetime-where.stderr b/src/test/ui/parser/bounds-lifetime-where.stderr index 4b3dea18d55..6a8d7e9d4a1 100644 --- a/src/test/ui/parser/bounds-lifetime-where.stderr +++ b/src/test/ui/parser/bounds-lifetime-where.stderr @@ -1,5 +1,5 @@ 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 `,` | ^ expected one of `=`, lifetime, or type here diff --git a/src/test/ui/parser/bounds-lifetime.rs b/src/test/ui/parser/bounds-lifetime.rs index 52b4556084f..89a969bb2e2 100644 --- a/src/test/ui/parser/bounds-lifetime.rs +++ b/src/test/ui/parser/bounds-lifetime.rs @@ -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 diff --git a/src/test/ui/parser/bounds-lifetime.stderr b/src/test/ui/parser/bounds-lifetime.stderr index e78d3990b50..f39e5beb6ac 100644 --- a/src/test/ui/parser/bounds-lifetime.stderr +++ b/src/test/ui/parser/bounds-lifetime.stderr @@ -1,5 +1,5 @@ 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 `,` | ^ expected one of `>`, identifier, or lifetime here diff --git a/src/test/ui/parser/bounds-obj-parens.rs b/src/test/ui/parser/bounds-obj-parens.rs index e855231969b..cc86879bf46 100644 --- a/src/test/ui/parser/bounds-obj-parens.rs +++ b/src/test/ui/parser/bounds-obj-parens.rs @@ -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() {} diff --git a/src/test/ui/parser/bounds-type-where.rs b/src/test/ui/parser/bounds-type-where.rs index fa10de30155..2520ecb294c 100644 --- a/src/test/ui/parser/bounds-type-where.rs +++ b/src/test/ui/parser/bounds-type-where.rs @@ -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 T: Trait, = u8; // OK type A where T: = u8; // OK diff --git a/src/test/ui/parser/bounds-type-where.stderr b/src/test/ui/parser/bounds-type-where.stderr index c29f3caa4c4..459d5c3b6ea 100644 --- a/src/test/ui/parser/bounds-type-where.stderr +++ b/src/test/ui/parser/bounds-type-where.stderr @@ -1,5 +1,5 @@ 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; | ^ expected one of 8 possible tokens here diff --git a/src/test/ui/parser/brace-after-qualified-path-in-match.rs b/src/test/ui/parser/brace-after-qualified-path-in-match.rs index 1e7d5197228..f4152086162 100644 --- a/src/test/ui/parser/brace-after-qualified-path-in-match.rs +++ b/src/test/ui/parser/brace-after-qualified-path-in-match.rs @@ -1,7 +1,5 @@ -// compile-flags: -Z parse-only - -fn foo() { - match x { +fn main() { + match 10 { ::Type{key: value} => (), //~^ ERROR unexpected `{` after qualified path _ => (), diff --git a/src/test/ui/parser/brace-after-qualified-path-in-match.stderr b/src/test/ui/parser/brace-after-qualified-path-in-match.stderr index 0afaf873ae2..4c49e3122c7 100644 --- a/src/test/ui/parser/brace-after-qualified-path-in-match.stderr +++ b/src/test/ui/parser/brace-after-qualified-path-in-match.stderr @@ -1,5 +1,5 @@ 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 | ::Type{key: value} => (), | ^ unexpected `{` after qualified path diff --git a/src/test/ui/parser/byte-literals.rs b/src/test/ui/parser/byte-literals.rs index 59dc5ef4139..bd358af2984 100644 --- a/src/test/ui/parser/byte-literals.rs +++ b/src/test/ui/parser/byte-literals.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error // ignore-tidy-tab diff --git a/src/test/ui/parser/byte-string-literals.rs b/src/test/ui/parser/byte-string-literals.rs index 82ab311bb59..d028f28655b 100644 --- a/src/test/ui/parser/byte-string-literals.rs +++ b/src/test/ui/parser/byte-string-literals.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error // ignore-tidy-tab diff --git a/src/test/ui/parser/circular_modules_hello.rs b/src/test/ui/parser/circular_modules_hello.rs index 06757fb4f9e..6968ca97b82 100644 --- a/src/test/ui/parser/circular_modules_hello.rs +++ b/src/test/ui/parser/circular_modules_hello.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // ignore-test: this is an auxiliary file for circular-modules-main.rs #[path = "circular_modules_main.rs"] diff --git a/src/test/ui/parser/circular_modules_main.rs b/src/test/ui/parser/circular_modules_main.rs index bd5c438d9be..b85003bf091 100644 --- a/src/test/ui/parser/circular_modules_main.rs +++ b/src/test/ui/parser/circular_modules_main.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - #[path = "circular_modules_hello.rs"] mod circular_modules_hello; //~ ERROR: circular modules diff --git a/src/test/ui/parser/circular_modules_main.stderr b/src/test/ui/parser/circular_modules_main.stderr index 0d54e2aa1d6..7751a8c0f38 100644 --- a/src/test/ui/parser/circular_modules_main.stderr +++ b/src/test/ui/parser/circular_modules_main.stderr @@ -1,5 +1,5 @@ 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 | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/parser/class-implements-bad-trait.rs b/src/test/ui/parser/class-implements-bad-trait.rs index 10ee1a9afd8..f2f85d0265a 100644 --- a/src/test/ui/parser/class-implements-bad-trait.rs +++ b/src/test/ui/parser/class-implements-bad-trait.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern:nonexistent class cat : nonexistent { let meows: usize; diff --git a/src/test/ui/parser/class-implements-bad-trait.stderr b/src/test/ui/parser/class-implements-bad-trait.stderr index 973f87af114..45583466adc 100644 --- a/src/test/ui/parser/class-implements-bad-trait.stderr +++ b/src/test/ui/parser/class-implements-bad-trait.stderr @@ -1,5 +1,5 @@ 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 { | ^^^ expected one of `!` or `::` here diff --git a/src/test/ui/parser/closure-return-syntax.rs b/src/test/ui/parser/closure-return-syntax.rs index ae675109b24..54eb791d2bc 100644 --- a/src/test/ui/parser/closure-return-syntax.rs +++ b/src/test/ui/parser/closure-return-syntax.rs @@ -1,8 +1,6 @@ // Test that we cannot parse a closure with an explicit return type // unless it uses braces. -// compile-flags: -Z parse-only - fn main() { let x = || -> i32 22; //~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22` diff --git a/src/test/ui/parser/closure-return-syntax.stderr b/src/test/ui/parser/closure-return-syntax.stderr index 884c213c5b4..dd7ebffd506 100644 --- a/src/test/ui/parser/closure-return-syntax.stderr +++ b/src/test/ui/parser/closure-return-syntax.stderr @@ -1,5 +1,5 @@ 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; | ^^ expected one of `!`, `(`, `+`, `::`, `<`, or `{` here diff --git a/src/test/ui/parser/column-offset-1-based.rs b/src/test/ui/parser/column-offset-1-based.rs index abd5e5a3678..e158e5247db 100644 --- a/src/test/ui/parser/column-offset-1-based.rs +++ b/src/test/ui/parser/column-offset-1-based.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - # //~ ERROR expected `[`, found `` diff --git a/src/test/ui/parser/column-offset-1-based.stderr b/src/test/ui/parser/column-offset-1-based.stderr index 992e1f12ff2..b12b47b67ce 100644 --- a/src/test/ui/parser/column-offset-1-based.stderr +++ b/src/test/ui/parser/column-offset-1-based.stderr @@ -1,5 +1,5 @@ error: expected `[`, found `` - --> $DIR/column-offset-1-based.rs:3:1 + --> $DIR/column-offset-1-based.rs:1:1 | LL | # //~ ERROR expected `[`, found `` | ^ expected `[` diff --git a/src/test/ui/parser/default.rs b/src/test/ui/parser/default.rs index fc092ebbc98..17cd06864bf 100644 --- a/src/test/ui/parser/default.rs +++ b/src/test/ui/parser/default.rs @@ -1,7 +1,7 @@ -// compile-flags: -Z parse-only - // Test successful and unsuccessful parsing of the `default` contextual keyword +#![feature(specialization)] + trait Foo { fn foo() -> T; } @@ -13,12 +13,12 @@ impl Foo for u8 { } impl Foo for u16 { - pub default fn foo() -> T { + pub default fn foo() -> T { //~ ERROR unnecessary visibility qualifier T::default() } } -impl Foo for u32 { +impl Foo for u32 { //~ ERROR not all trait items implemented, missing: `foo` default pub fn foo() -> T { T::default() } //~ ERROR expected one of } diff --git a/src/test/ui/parser/default.stderr b/src/test/ui/parser/default.stderr index ff87706b2d2..27193672903 100644 --- a/src/test/ui/parser/default.stderr +++ b/src/test/ui/parser/default.stderr @@ -4,5 +4,22 @@ error: expected one of `async`, `const`, `existential`, `extern`, `fn`, `type`, LL | default pub fn foo() -> T { T::default() } //~ ERROR expected one of | ^^^ 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 { //~ 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; + | -------------------------- `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`. diff --git a/src/test/ui/parser/do-catch-suggests-try.rs b/src/test/ui/parser/do-catch-suggests-try.rs index 7ab78dc49d7..61fae721ffb 100644 --- a/src/test/ui/parser/do-catch-suggests-try.rs +++ b/src/test/ui/parser/do-catch-suggests-try.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let _: Option<()> = do catch {}; //~^ ERROR found removed `do catch` syntax diff --git a/src/test/ui/parser/do-catch-suggests-try.stderr b/src/test/ui/parser/do-catch-suggests-try.stderr index 085cb9dac17..6d13b0f1cc8 100644 --- a/src/test/ui/parser/do-catch-suggests-try.stderr +++ b/src/test/ui/parser/do-catch-suggests-try.stderr @@ -1,5 +1,5 @@ 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 {}; | ^^ diff --git a/src/test/ui/parser/doc-after-struct-field.rs b/src/test/ui/parser/doc-after-struct-field.rs index 8a1904f228a..7870555aebb 100644 --- a/src/test/ui/parser/doc-after-struct-field.rs +++ b/src/test/ui/parser/doc-after-struct-field.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error struct X { a: u8 /** document a */, diff --git a/src/test/ui/parser/doc-before-attr.rs b/src/test/ui/parser/doc-before-attr.rs index 73c644682c7..c4125a09fd2 100644 --- a/src/test/ui/parser/doc-before-attr.rs +++ b/src/test/ui/parser/doc-before-attr.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only +fn main() {} /// hi #[derive(Debug)] //~ERROR expected item after attributes diff --git a/src/test/ui/parser/doc-before-eof.rs b/src/test/ui/parser/doc-before-eof.rs index 4cf74001436..b31836e95e8 100644 --- a/src/test/ui/parser/doc-before-eof.rs +++ b/src/test/ui/parser/doc-before-eof.rs @@ -1,3 +1,3 @@ -// compile-flags: -Z parse-only +fn main() {} /// hi //~ERROR expected item after doc comment diff --git a/src/test/ui/parser/doc-before-extern-rbrace.rs b/src/test/ui/parser/doc-before-extern-rbrace.rs index ec893162323..695d4da1dca 100644 --- a/src/test/ui/parser/doc-before-extern-rbrace.rs +++ b/src/test/ui/parser/doc-before-extern-rbrace.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - extern { /// hi //~^ ERROR expected item after doc comment diff --git a/src/test/ui/parser/doc-before-extern-rbrace.stderr b/src/test/ui/parser/doc-before-extern-rbrace.stderr index e73fc0551cd..47fab7b40f4 100644 --- a/src/test/ui/parser/doc-before-extern-rbrace.stderr +++ b/src/test/ui/parser/doc-before-extern-rbrace.stderr @@ -1,5 +1,5 @@ error: expected item after doc comment - --> $DIR/doc-before-extern-rbrace.rs:4:5 + --> $DIR/doc-before-extern-rbrace.rs:2:5 | LL | /// hi | ^^^^^^ diff --git a/src/test/ui/parser/doc-before-fn-rbrace.rs b/src/test/ui/parser/doc-before-fn-rbrace.rs index 68a5dd3cfe5..d33520baebe 100644 --- a/src/test/ui/parser/doc-before-fn-rbrace.rs +++ b/src/test/ui/parser/doc-before-fn-rbrace.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error fn main() { /// document diff --git a/src/test/ui/parser/doc-before-identifier.rs b/src/test/ui/parser/doc-before-identifier.rs index 7dc472d915f..d9777be63d2 100644 --- a/src/test/ui/parser/doc-before-identifier.rs +++ b/src/test/ui/parser/doc-before-identifier.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error fn /// document foo() {} diff --git a/src/test/ui/parser/doc-before-mod-rbrace.rs b/src/test/ui/parser/doc-before-mod-rbrace.rs index 9ce6f99a764..4e0b65ef496 100644 --- a/src/test/ui/parser/doc-before-mod-rbrace.rs +++ b/src/test/ui/parser/doc-before-mod-rbrace.rs @@ -1,6 +1,8 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error mod Foo { /// document //~^ ERROR expected item after doc comment } + +fn main() {} diff --git a/src/test/ui/parser/doc-before-rbrace.rs b/src/test/ui/parser/doc-before-rbrace.rs index d24f711397b..8ff946344ae 100644 --- a/src/test/ui/parser/doc-before-rbrace.rs +++ b/src/test/ui/parser/doc-before-rbrace.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { println!("Hi"); /// hi //~^ ERROR found a documentation comment that doesn't document anything diff --git a/src/test/ui/parser/doc-before-rbrace.stderr b/src/test/ui/parser/doc-before-rbrace.stderr index 2c6c93e469a..55719cf6411 100644 --- a/src/test/ui/parser/doc-before-rbrace.stderr +++ b/src/test/ui/parser/doc-before-rbrace.stderr @@ -1,5 +1,5 @@ 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 | ^^^^^^ diff --git a/src/test/ui/parser/doc-before-semi.rs b/src/test/ui/parser/doc-before-semi.rs index 2d5d549d4c3..405a7e1e2a3 100644 --- a/src/test/ui/parser/doc-before-semi.rs +++ b/src/test/ui/parser/doc-before-semi.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { /// hi //~^ ERROR found a documentation comment that doesn't document anything diff --git a/src/test/ui/parser/doc-before-semi.stderr b/src/test/ui/parser/doc-before-semi.stderr index f1960ae7ac3..e6bade18d0a 100644 --- a/src/test/ui/parser/doc-before-semi.stderr +++ b/src/test/ui/parser/doc-before-semi.stderr @@ -1,5 +1,5 @@ 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 | ^^^^^^ diff --git a/src/test/ui/parser/doc-before-struct-rbrace-1.rs b/src/test/ui/parser/doc-before-struct-rbrace-1.rs index b67fc28885b..e7055f6a5fc 100644 --- a/src/test/ui/parser/doc-before-struct-rbrace-1.rs +++ b/src/test/ui/parser/doc-before-struct-rbrace-1.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error struct X { a: u8, diff --git a/src/test/ui/parser/doc-before-struct-rbrace-2.rs b/src/test/ui/parser/doc-before-struct-rbrace-2.rs index e0e98681a95..d5c2a314cbb 100644 --- a/src/test/ui/parser/doc-before-struct-rbrace-2.rs +++ b/src/test/ui/parser/doc-before-struct-rbrace-2.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error struct X { a: u8 /// document diff --git a/src/test/ui/parser/duplicate-visibility.rs b/src/test/ui/parser/duplicate-visibility.rs index 0c08af61fa8..bb17e97e950 100644 --- a/src/test/ui/parser/duplicate-visibility.rs +++ b/src/test/ui/parser/duplicate-visibility.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern:expected one of `(`, `fn`, `static`, or `type` extern { pub pub fn foo(); diff --git a/src/test/ui/parser/duplicate-visibility.stderr b/src/test/ui/parser/duplicate-visibility.stderr index 7b16cddf305..880b536cd18 100644 --- a/src/test/ui/parser/duplicate-visibility.stderr +++ b/src/test/ui/parser/duplicate-visibility.stderr @@ -1,5 +1,5 @@ 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(); | ^^^ expected one of `(`, `fn`, `static`, or `type` here diff --git a/src/test/ui/parser/empty-impl-semicolon.rs b/src/test/ui/parser/empty-impl-semicolon.rs index 57fad0e9312..207ebef642b 100644 --- a/src/test/ui/parser/empty-impl-semicolon.rs +++ b/src/test/ui/parser/empty-impl-semicolon.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;` diff --git a/src/test/ui/parser/empty-impl-semicolon.stderr b/src/test/ui/parser/empty-impl-semicolon.stderr index 770eab3f46a..965a8a45aed 100644 --- a/src/test/ui/parser/empty-impl-semicolon.stderr +++ b/src/test/ui/parser/empty-impl-semicolon.stderr @@ -1,5 +1,5 @@ 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 `;` | ^ expected one of 8 possible tokens here diff --git a/src/test/ui/parser/extern-crate-unexpected-token.rs b/src/test/ui/parser/extern-crate-unexpected-token.rs index c383de6f6c1..58b2fa1afdf 100644 --- a/src/test/ui/parser/extern-crate-unexpected-token.rs +++ b/src/test/ui/parser/extern-crate-unexpected-token.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte` diff --git a/src/test/ui/parser/extern-crate-unexpected-token.stderr b/src/test/ui/parser/extern-crate-unexpected-token.stderr index b45920aa639..ed888eb1a8e 100644 --- a/src/test/ui/parser/extern-crate-unexpected-token.stderr +++ b/src/test/ui/parser/extern-crate-unexpected-token.stderr @@ -1,5 +1,5 @@ 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` | ^^^^ expected one of `crate`, `fn`, or `{` here diff --git a/src/test/ui/parser/extern-expected-fn-or-brace.rs b/src/test/ui/parser/extern-expected-fn-or-brace.rs index 137133299d8..dd46b87fa42 100644 --- a/src/test/ui/parser/extern-expected-fn-or-brace.rs +++ b/src/test/ui/parser/extern-expected-fn-or-brace.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Verifies that the expected token errors for `extern crate` are // raised diff --git a/src/test/ui/parser/extern-expected-fn-or-brace.stderr b/src/test/ui/parser/extern-expected-fn-or-brace.stderr index 4bd95dbeee3..94b2d1d7b7e 100644 --- a/src/test/ui/parser/extern-expected-fn-or-brace.stderr +++ b/src/test/ui/parser/extern-expected-fn-or-brace.stderr @@ -1,5 +1,5 @@ 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` | ^^^ expected one of `fn` or `{` here diff --git a/src/test/ui/parser/extern-foreign-crate.rs b/src/test/ui/parser/extern-foreign-crate.rs index d770b6687c9..a5da77dc763 100644 --- a/src/test/ui/parser/extern-foreign-crate.rs +++ b/src/test/ui/parser/extern-foreign-crate.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Verifies that the expected token errors for `extern crate` are // raised diff --git a/src/test/ui/parser/extern-foreign-crate.stderr b/src/test/ui/parser/extern-foreign-crate.stderr index 32b26670ea8..d2fe8b77ce6 100644 --- a/src/test/ui/parser/extern-foreign-crate.stderr +++ b/src/test/ui/parser/extern-foreign-crate.stderr @@ -1,5 +1,5 @@ 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 `{` | ^ expected one of `;` or `as` here diff --git a/src/test/ui/parser/extern-no-fn.rs b/src/test/ui/parser/extern-no-fn.rs index 2836ec7d160..c37ddd69ce5 100644 --- a/src/test/ui/parser/extern-no-fn.rs +++ b/src/test/ui/parser/extern-no-fn.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - extern { //~ ERROR missing `fn`, `type`, or `static` for extern-item declaration f(); } diff --git a/src/test/ui/parser/extern-no-fn.stderr b/src/test/ui/parser/extern-no-fn.stderr index 5a3618cc0b9..e764cd08401 100644 --- a/src/test/ui/parser/extern-no-fn.stderr +++ b/src/test/ui/parser/extern-no-fn.stderr @@ -1,5 +1,5 @@ error: missing `fn`, `type`, or `static` for extern-item declaration - --> $DIR/extern-no-fn.rs:3:9 + --> $DIR/extern-no-fn.rs:1:9 | LL | extern { //~ ERROR missing `fn`, `type`, or `static` for extern-item declaration | _________^ diff --git a/src/test/ui/parser/if-in-in.rs b/src/test/ui/parser/if-in-in.rs index 70088631db6..212378c2866 100644 --- a/src/test/ui/parser/if-in-in.rs +++ b/src/test/ui/parser/if-in-in.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { for i in in 1..2 { //~ ERROR expected iterable, found keyword `in` println!("{}", i); diff --git a/src/test/ui/parser/if-in-in.stderr b/src/test/ui/parser/if-in-in.stderr index d741c70e580..2938bba77d7 100644 --- a/src/test/ui/parser/if-in-in.stderr +++ b/src/test/ui/parser/if-in-in.stderr @@ -1,5 +1,5 @@ error: expected iterable, found keyword `in` - --> $DIR/if-in-in.rs:4:14 + --> $DIR/if-in-in.rs:2:14 | LL | for i in in 1..2 { //~ ERROR expected iterable, found keyword `in` | ---^^ diff --git a/src/test/ui/parser/impl-parsing.rs b/src/test/ui/parser/impl-parsing.rs index 4bfdb241dfd..c2a80e8fa15 100644 --- a/src/test/ui/parser/impl-parsing.rs +++ b/src/test/ui/parser/impl-parsing.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error impl ! {} // OK impl ! where u8: Copy {} // OK diff --git a/src/test/ui/parser/import-from-path.rs b/src/test/ui/parser/import-from-path.rs index e3fee987ab7..3fce08259fc 100644 --- a/src/test/ui/parser/import-from-path.rs +++ b/src/test/ui/parser/import-from-path.rs @@ -1,4 +1,2 @@ -// compile-flags: -Z parse-only - // error-pattern:expected use foo::{bar}::baz diff --git a/src/test/ui/parser/import-from-path.stderr b/src/test/ui/parser/import-from-path.stderr index 0afc17877f7..5842037fb80 100644 --- a/src/test/ui/parser/import-from-path.stderr +++ b/src/test/ui/parser/import-from-path.stderr @@ -1,5 +1,5 @@ error: expected `;`, found `::` - --> $DIR/import-from-path.rs:4:15 + --> $DIR/import-from-path.rs:2:15 | LL | use foo::{bar}::baz | ^^ expected `;` diff --git a/src/test/ui/parser/import-from-rename.rs b/src/test/ui/parser/import-from-rename.rs index 498bbd6b0ff..27425a3c99a 100644 --- a/src/test/ui/parser/import-from-rename.rs +++ b/src/test/ui/parser/import-from-rename.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern:expected use foo::{bar} as baz; diff --git a/src/test/ui/parser/import-from-rename.stderr b/src/test/ui/parser/import-from-rename.stderr index 6afdc247c3a..a966e993737 100644 --- a/src/test/ui/parser/import-from-rename.stderr +++ b/src/test/ui/parser/import-from-rename.stderr @@ -1,5 +1,5 @@ error: expected `;`, found keyword `as` - --> $DIR/import-from-rename.rs:5:16 + --> $DIR/import-from-rename.rs:3:16 | LL | use foo::{bar} as baz; | ^^ expected `;` diff --git a/src/test/ui/parser/import-glob-path.rs b/src/test/ui/parser/import-glob-path.rs index 5a3a581fca4..de4c07aa7bb 100644 --- a/src/test/ui/parser/import-glob-path.rs +++ b/src/test/ui/parser/import-glob-path.rs @@ -1,4 +1,2 @@ -// compile-flags: -Z parse-only - // error-pattern:expected use foo::*::bar diff --git a/src/test/ui/parser/import-glob-path.stderr b/src/test/ui/parser/import-glob-path.stderr index a8426b7351c..ebca2db8305 100644 --- a/src/test/ui/parser/import-glob-path.stderr +++ b/src/test/ui/parser/import-glob-path.stderr @@ -1,5 +1,5 @@ error: expected `;`, found `::` - --> $DIR/import-glob-path.rs:4:11 + --> $DIR/import-glob-path.rs:2:11 | LL | use foo::*::bar | ^^ expected `;` diff --git a/src/test/ui/parser/import-glob-rename.rs b/src/test/ui/parser/import-glob-rename.rs index f96f48d5fd6..b9b753dcd70 100644 --- a/src/test/ui/parser/import-glob-rename.rs +++ b/src/test/ui/parser/import-glob-rename.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern:expected use foo::* as baz; diff --git a/src/test/ui/parser/import-glob-rename.stderr b/src/test/ui/parser/import-glob-rename.stderr index 475c8d7b972..28538732782 100644 --- a/src/test/ui/parser/import-glob-rename.stderr +++ b/src/test/ui/parser/import-glob-rename.stderr @@ -1,5 +1,5 @@ error: expected `;`, found keyword `as` - --> $DIR/import-glob-rename.rs:5:12 + --> $DIR/import-glob-rename.rs:3:12 | LL | use foo::* as baz; | ^^ expected `;` diff --git a/src/test/ui/parser/inner-attr-after-doc-comment.rs b/src/test/ui/parser/inner-attr-after-doc-comment.rs index 1c72ed091af..36f4191f06b 100644 --- a/src/test/ui/parser/inner-attr-after-doc-comment.rs +++ b/src/test/ui/parser/inner-attr-after-doc-comment.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - #![feature(lang_items)] /** * My module diff --git a/src/test/ui/parser/inner-attr-after-doc-comment.stderr b/src/test/ui/parser/inner-attr-after-doc-comment.stderr index 8ce82b5238a..0dde49a2913 100644 --- a/src/test/ui/parser/inner-attr-after-doc-comment.stderr +++ b/src/test/ui/parser/inner-attr-after-doc-comment.stderr @@ -1,5 +1,5 @@ error: an inner attribute is not permitted following an outer doc comment - --> $DIR/inner-attr-after-doc-comment.rs:8:3 + --> $DIR/inner-attr-after-doc-comment.rs:6:3 | LL | #![recursion_limit="100"] | ^ diff --git a/src/test/ui/parser/inner-attr.rs b/src/test/ui/parser/inner-attr.rs index 07bcf0780f6..1b405e20e03 100644 --- a/src/test/ui/parser/inner-attr.rs +++ b/src/test/ui/parser/inner-attr.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - #[feature(lang_items)] #![recursion_limit="100"] //~ ERROR an inner attribute is not permitted following an outer attribute diff --git a/src/test/ui/parser/inner-attr.stderr b/src/test/ui/parser/inner-attr.stderr index bce0b74e068..001eab226dc 100644 --- a/src/test/ui/parser/inner-attr.stderr +++ b/src/test/ui/parser/inner-attr.stderr @@ -1,5 +1,5 @@ error: an inner attribute is not permitted following an outer attribute - --> $DIR/inner-attr.rs:5:3 + --> $DIR/inner-attr.rs:3:3 | LL | #![recursion_limit="100"] //~ ERROR an inner attribute is not permitted following an outer attribute | ^ diff --git a/src/test/ui/parser/int-literal-too-large-span.rs b/src/test/ui/parser/int-literal-too-large-span.rs index 0de71396640..206242c3c7f 100644 --- a/src/test/ui/parser/int-literal-too-large-span.rs +++ b/src/test/ui/parser/int-literal-too-large-span.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // issue #17123 fn main() { diff --git a/src/test/ui/parser/int-literal-too-large-span.stderr b/src/test/ui/parser/int-literal-too-large-span.stderr index 26e115ef1a2..d7774c333c2 100644 --- a/src/test/ui/parser/int-literal-too-large-span.stderr +++ b/src/test/ui/parser/int-literal-too-large-span.stderr @@ -1,5 +1,5 @@ error: int literal is too large - --> $DIR/int-literal-too-large-span.rs:6:5 + --> $DIR/int-literal-too-large-span.rs:4:5 | LL | 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/parser/inverted-parameters.rs b/src/test/ui/parser/inverted-parameters.rs index c0d9523db16..42430278c72 100644 --- a/src/test/ui/parser/inverted-parameters.rs +++ b/src/test/ui/parser/inverted-parameters.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - struct S; impl S { diff --git a/src/test/ui/parser/inverted-parameters.stderr b/src/test/ui/parser/inverted-parameters.stderr index f733424e57b..bdb8faa6c65 100644 --- a/src/test/ui/parser/inverted-parameters.stderr +++ b/src/test/ui/parser/inverted-parameters.stderr @@ -1,5 +1,5 @@ error: expected one of `:` or `@`, found `bar` - --> $DIR/inverted-parameters.rs:6:24 + --> $DIR/inverted-parameters.rs:4:24 | LL | fn foo(&self, &str bar) {} | -----^^^ @@ -8,7 +8,7 @@ LL | fn foo(&self, &str bar) {} | help: declare the type after the parameter binding: `: ` error: expected one of `:` or `@`, found `quux` - --> $DIR/inverted-parameters.rs:12:10 + --> $DIR/inverted-parameters.rs:10:10 | LL | fn baz(S quux, xyzzy: i32) {} | --^^^^ @@ -17,25 +17,25 @@ LL | fn baz(S quux, xyzzy: i32) {} | help: declare the type after the parameter binding: `: ` error: expected one of `:` or `@`, found `a` - --> $DIR/inverted-parameters.rs:17:12 + --> $DIR/inverted-parameters.rs:15:12 | LL | fn one(i32 a b) {} | ^ expected one of `:` or `@` here error: expected `:`, found `(` - --> $DIR/inverted-parameters.rs:20:23 + --> $DIR/inverted-parameters.rs:18:23 | LL | fn pattern((i32, i32) (a, b)) {} | ^ expected `:` error: expected one of `:` or `@`, found `)` - --> $DIR/inverted-parameters.rs:23:12 + --> $DIR/inverted-parameters.rs:21:12 | LL | fn fizz(i32) {} | ^ expected one of `:` or `@` here error: expected one of `:` or `@`, found `S` - --> $DIR/inverted-parameters.rs:26:23 + --> $DIR/inverted-parameters.rs:24:23 | LL | fn missing_colon(quux S) {} | -----^ diff --git a/src/test/ui/parser/issue-10392-2.rs b/src/test/ui/parser/issue-10392-2.rs index 63d3f4c5b1b..3b5e3199a8a 100644 --- a/src/test/ui/parser/issue-10392-2.rs +++ b/src/test/ui/parser/issue-10392-2.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - struct A { foo: isize } fn a() -> A { panic!() } diff --git a/src/test/ui/parser/issue-10392-2.stderr b/src/test/ui/parser/issue-10392-2.stderr index 9c04ba37e98..47e1f7adf25 100644 --- a/src/test/ui/parser/issue-10392-2.stderr +++ b/src/test/ui/parser/issue-10392-2.stderr @@ -1,5 +1,5 @@ error: expected `}`, found `,` - --> $DIR/issue-10392-2.rs:8:15 + --> $DIR/issue-10392-2.rs:6:15 | LL | let A { .., } = a(); //~ ERROR: expected `}` | --^ diff --git a/src/test/ui/parser/issue-10392.rs b/src/test/ui/parser/issue-10392.rs index 41f6e342676..dd84af39300 100644 --- a/src/test/ui/parser/issue-10392.rs +++ b/src/test/ui/parser/issue-10392.rs @@ -1,9 +1,8 @@ -// compile-flags: -Z parse-only - struct A { foo: isize } fn a() -> A { panic!() } fn main() { - let A { , } = a(); //~ ERROR: expected ident + let A { , } = a(); //~ ERROR expected ident + //~| ERROR pattern does not mention field `foo` } diff --git a/src/test/ui/parser/issue-10392.stderr b/src/test/ui/parser/issue-10392.stderr index e8af0091968..9c9858aa26c 100644 --- a/src/test/ui/parser/issue-10392.stderr +++ b/src/test/ui/parser/issue-10392.stderr @@ -1,8 +1,15 @@ error: expected identifier, found `,` - --> $DIR/issue-10392.rs:8:13 + --> $DIR/issue-10392.rs:6:13 | -LL | let A { , } = a(); //~ ERROR: expected ident +LL | let A { , } = a(); //~ ERROR expected ident | ^ expected identifier -error: aborting due to previous error +error[E0027]: pattern does not mention field `foo` + --> $DIR/issue-10392.rs:6:9 + | +LL | let A { , } = a(); //~ ERROR expected ident + | ^^^^^^^ missing field `foo` +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0027`. diff --git a/src/test/ui/parser/issue-10636-1.rs b/src/test/ui/parser/issue-10636-1.rs index 0bb55cc9a72..e495c0411d8 100644 --- a/src/test/ui/parser/issue-10636-1.rs +++ b/src/test/ui/parser/issue-10636-1.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - struct Obj { //~^ NOTE: un-closed delimiter member: usize diff --git a/src/test/ui/parser/issue-10636-1.stderr b/src/test/ui/parser/issue-10636-1.stderr index 233f37c5c7d..894139f24dd 100644 --- a/src/test/ui/parser/issue-10636-1.stderr +++ b/src/test/ui/parser/issue-10636-1.stderr @@ -1,5 +1,5 @@ error: incorrect close delimiter: `)` - --> $DIR/issue-10636-1.rs:6:1 + --> $DIR/issue-10636-1.rs:4:1 | LL | struct Obj { | - un-closed delimiter diff --git a/src/test/ui/parser/issue-10636-2.rs b/src/test/ui/parser/issue-10636-2.rs index de3208e5234..a02fd41b349 100644 --- a/src/test/ui/parser/issue-10636-2.rs +++ b/src/test/ui/parser/issue-10636-2.rs @@ -1,8 +1,6 @@ // FIXME(31528) we emit a bunch of silly errors here due to continuing past the // first one. This would be easy-ish to address by better recovery in tokenisation. -// compile-flags: -Z parse-only - pub fn trace_option(option: Option) { option.map(|some| 42; //~^ ERROR: expected one of diff --git a/src/test/ui/parser/issue-10636-2.stderr b/src/test/ui/parser/issue-10636-2.stderr index d6a8b525f35..9b3115cb3f4 100644 --- a/src/test/ui/parser/issue-10636-2.stderr +++ b/src/test/ui/parser/issue-10636-2.stderr @@ -1,5 +1,5 @@ error: incorrect close delimiter: `}` - --> $DIR/issue-10636-2.rs:10:1 + --> $DIR/issue-10636-2.rs:8:1 | LL | pub fn trace_option(option: Option) { | - close delimiter possibly meant for this @@ -10,13 +10,13 @@ LL | } //~ ERROR: incorrect close delimiter | ^ incorrect close delimiter error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` - --> $DIR/issue-10636-2.rs:7:25 + --> $DIR/issue-10636-2.rs:5:25 | LL | option.map(|some| 42; | ^ expected one of `)`, `,`, `.`, `?`, or an operator here error: expected expression, found `)` - --> $DIR/issue-10636-2.rs:10:1 + --> $DIR/issue-10636-2.rs:8:1 | LL | } //~ ERROR: incorrect close delimiter | ^ expected expression diff --git a/src/test/ui/parser/issue-14303-enum.rs b/src/test/ui/parser/issue-14303-enum.rs index c111959f50b..a6106159805 100644 --- a/src/test/ui/parser/issue-14303-enum.rs +++ b/src/test/ui/parser/issue-14303-enum.rs @@ -1,6 +1,6 @@ -// compile-flags: -Z parse-only - enum X<'a, T, 'b> { //~^ ERROR lifetime parameters must be declared prior to type parameters - A(&'a T) + A(&'a &'b T) } + +fn main() {} diff --git a/src/test/ui/parser/issue-14303-enum.stderr b/src/test/ui/parser/issue-14303-enum.stderr index f69129573d6..a31429e7228 100644 --- a/src/test/ui/parser/issue-14303-enum.stderr +++ b/src/test/ui/parser/issue-14303-enum.stderr @@ -1,5 +1,5 @@ error: lifetime parameters must be declared prior to type parameters - --> $DIR/issue-14303-enum.rs:3:15 + --> $DIR/issue-14303-enum.rs:1:15 | LL | enum X<'a, T, 'b> { | ^^ diff --git a/src/test/ui/parser/issue-14303-fn-def.rs b/src/test/ui/parser/issue-14303-fn-def.rs index 1ad15f9064d..221bd311e74 100644 --- a/src/test/ui/parser/issue-14303-fn-def.rs +++ b/src/test/ui/parser/issue-14303-fn-def.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only - fn foo<'a, T, 'b>(x: &'a T) {} //~^ ERROR lifetime parameters must be declared prior to type parameters + +fn main() {} diff --git a/src/test/ui/parser/issue-14303-fn-def.stderr b/src/test/ui/parser/issue-14303-fn-def.stderr index 4fe3856768c..4582aeef428 100644 --- a/src/test/ui/parser/issue-14303-fn-def.stderr +++ b/src/test/ui/parser/issue-14303-fn-def.stderr @@ -1,5 +1,5 @@ error: lifetime parameters must be declared prior to type parameters - --> $DIR/issue-14303-fn-def.rs:3:15 + --> $DIR/issue-14303-fn-def.rs:1:15 | LL | fn foo<'a, T, 'b>(x: &'a T) {} | ^^ diff --git a/src/test/ui/parser/issue-14303-fncall.rs b/src/test/ui/parser/issue-14303-fncall.rs index 3642b80a01b..f5894349e15 100644 --- a/src/test/ui/parser/issue-14303-fncall.rs +++ b/src/test/ui/parser/issue-14303-fncall.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { (0..4) .map(|x| x * 2) diff --git a/src/test/ui/parser/issue-14303-fncall.stderr b/src/test/ui/parser/issue-14303-fncall.stderr index cde084784bb..1cc82f523c4 100644 --- a/src/test/ui/parser/issue-14303-fncall.stderr +++ b/src/test/ui/parser/issue-14303-fncall.stderr @@ -1,5 +1,5 @@ error: lifetime parameters must be declared prior to type parameters - --> $DIR/issue-14303-fncall.rs:6:31 + --> $DIR/issue-14303-fncall.rs:4:31 | LL | .collect::>() | ^^ diff --git a/src/test/ui/parser/issue-14303-impl.rs b/src/test/ui/parser/issue-14303-impl.rs index 64301530fb3..4dc2c666018 100644 --- a/src/test/ui/parser/issue-14303-impl.rs +++ b/src/test/ui/parser/issue-14303-impl.rs @@ -1,6 +1,6 @@ -// compile-flags: -Z parse-only +struct X(T); -struct X { x: isize } - -impl<'a, T, 'b> X {} +impl<'a, T, 'b> X {} //~^ ERROR lifetime parameters must be declared prior to type parameters + +fn main() {} diff --git a/src/test/ui/parser/issue-14303-impl.stderr b/src/test/ui/parser/issue-14303-impl.stderr index f4ea550acb5..a1953396153 100644 --- a/src/test/ui/parser/issue-14303-impl.stderr +++ b/src/test/ui/parser/issue-14303-impl.stderr @@ -1,11 +1,11 @@ error: lifetime parameters must be declared prior to type parameters - --> $DIR/issue-14303-impl.rs:5:13 + --> $DIR/issue-14303-impl.rs:3:13 | -LL | impl<'a, T, 'b> X {} +LL | impl<'a, T, 'b> X {} | ^^ help: move the lifetime parameter prior to the first type parameter | -LL | impl<'a, 'b, T> X {} +LL | impl<'a, 'b, T> X {} | ^^^ -- error: aborting due to previous error diff --git a/src/test/ui/parser/issue-14303-path.rs b/src/test/ui/parser/issue-14303-path.rs index 0f0641e55df..f61cb6b8dd6 100644 --- a/src/test/ui/parser/issue-14303-path.rs +++ b/src/test/ui/parser/issue-14303-path.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only - fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {} //~^ ERROR lifetime parameters must be declared prior to type parameters + +fn main() {} diff --git a/src/test/ui/parser/issue-14303-path.stderr b/src/test/ui/parser/issue-14303-path.stderr index 155fa465f4f..3de8a169c69 100644 --- a/src/test/ui/parser/issue-14303-path.stderr +++ b/src/test/ui/parser/issue-14303-path.stderr @@ -1,5 +1,5 @@ error: lifetime parameters must be declared prior to type parameters - --> $DIR/issue-14303-path.rs:3:37 + --> $DIR/issue-14303-path.rs:1:37 | LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {} | ^^ diff --git a/src/test/ui/parser/issue-14303-struct.rs b/src/test/ui/parser/issue-14303-struct.rs index d9d58599088..0bd10b4d085 100644 --- a/src/test/ui/parser/issue-14303-struct.rs +++ b/src/test/ui/parser/issue-14303-struct.rs @@ -1,6 +1,6 @@ -// compile-flags: -Z parse-only - struct X<'a, T, 'b> { //~^ ERROR lifetime parameters must be declared prior to type parameters - x: &'a T + x: &'a &'b T } + +fn main() {} diff --git a/src/test/ui/parser/issue-14303-struct.stderr b/src/test/ui/parser/issue-14303-struct.stderr index 3d8c74c7657..668b8d1de68 100644 --- a/src/test/ui/parser/issue-14303-struct.stderr +++ b/src/test/ui/parser/issue-14303-struct.stderr @@ -1,5 +1,5 @@ error: lifetime parameters must be declared prior to type parameters - --> $DIR/issue-14303-struct.rs:3:17 + --> $DIR/issue-14303-struct.rs:1:17 | LL | struct X<'a, T, 'b> { | ^^ diff --git a/src/test/ui/parser/issue-14303-trait.rs b/src/test/ui/parser/issue-14303-trait.rs index fb4c01ac71c..f253de92d92 100644 --- a/src/test/ui/parser/issue-14303-trait.rs +++ b/src/test/ui/parser/issue-14303-trait.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only - trait Foo<'a, T, 'b> {} //~^ ERROR lifetime parameters must be declared prior to type parameters + +fn main() {} diff --git a/src/test/ui/parser/issue-14303-trait.stderr b/src/test/ui/parser/issue-14303-trait.stderr index 4f6b18d93f7..11ce0c44351 100644 --- a/src/test/ui/parser/issue-14303-trait.stderr +++ b/src/test/ui/parser/issue-14303-trait.stderr @@ -1,5 +1,5 @@ error: lifetime parameters must be declared prior to type parameters - --> $DIR/issue-14303-trait.rs:3:18 + --> $DIR/issue-14303-trait.rs:1:18 | LL | trait Foo<'a, T, 'b> {} | ^^ diff --git a/src/test/ui/parser/issue-15914.rs b/src/test/ui/parser/issue-15914.rs index c82e2b6eb0b..4a5606af6d0 100644 --- a/src/test/ui/parser/issue-15914.rs +++ b/src/test/ui/parser/issue-15914.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let ref (); //~ ERROR expected identifier, found `(` diff --git a/src/test/ui/parser/issue-15914.stderr b/src/test/ui/parser/issue-15914.stderr index 0c70a7f0a5c..3a886c4c481 100644 --- a/src/test/ui/parser/issue-15914.stderr +++ b/src/test/ui/parser/issue-15914.stderr @@ -1,5 +1,5 @@ error: expected identifier, found `(` - --> $DIR/issue-15914.rs:5:9 + --> $DIR/issue-15914.rs:3:9 | LL | (); //~ ERROR expected identifier, found `(` | ^ expected identifier diff --git a/src/test/ui/parser/issue-15980.rs b/src/test/ui/parser/issue-15980.rs index 44000211a0a..ba874fb4476 100644 --- a/src/test/ui/parser/issue-15980.rs +++ b/src/test/ui/parser/issue-15980.rs @@ -1,9 +1,7 @@ -// compile-flags: -Z parse-only - use std::io; fn main(){ - let x: io::IoResult<()> = Ok(()); + let x: io::Result<()> = Ok(()); match x { Err(ref e) if e.kind == io::EndOfFile { //~^ NOTE while parsing this struct diff --git a/src/test/ui/parser/issue-15980.stderr b/src/test/ui/parser/issue-15980.stderr index 96f3b03dc92..c91595208c8 100644 --- a/src/test/ui/parser/issue-15980.stderr +++ b/src/test/ui/parser/issue-15980.stderr @@ -1,5 +1,5 @@ error: expected identifier, found keyword `return` - --> $DIR/issue-15980.rs:10:13 + --> $DIR/issue-15980.rs:8:13 | LL | Err(ref e) if e.kind == io::EndOfFile { | ------------- while parsing this struct @@ -12,7 +12,7 @@ LL | r#return | error: expected one of `.`, `=>`, `?`, or an operator, found `_` - --> $DIR/issue-15980.rs:15:9 + --> $DIR/issue-15980.rs:13:9 | LL | } | - expected one of `.`, `=>`, `?`, or an operator here diff --git a/src/test/ui/parser/issue-1655.rs b/src/test/ui/parser/issue-1655.rs index 2be809bf256..3d0bf3c1c7b 100644 --- a/src/test/ui/parser/issue-1655.rs +++ b/src/test/ui/parser/issue-1655.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern:expected `[`, found `vec` mod blade_runner { #vec[doc( diff --git a/src/test/ui/parser/issue-1655.stderr b/src/test/ui/parser/issue-1655.stderr index 8a8e100a890..3f656b63cdb 100644 --- a/src/test/ui/parser/issue-1655.stderr +++ b/src/test/ui/parser/issue-1655.stderr @@ -1,5 +1,5 @@ error: expected `[`, found `vec` - --> $DIR/issue-1655.rs:5:6 + --> $DIR/issue-1655.rs:3:6 | LL | #vec[doc( | ^^^ expected `[` diff --git a/src/test/ui/parser/issue-17383.rs b/src/test/ui/parser/issue-17383.rs index bbe3a9b8dac..9c00289287c 100644 --- a/src/test/ui/parser/issue-17383.rs +++ b/src/test/ui/parser/issue-17383.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - enum X { A = b'a' //~ ERROR discriminator values can only be used with a field-less enum diff --git a/src/test/ui/parser/issue-17383.stderr b/src/test/ui/parser/issue-17383.stderr index 808e3999e05..b225e11066d 100644 --- a/src/test/ui/parser/issue-17383.stderr +++ b/src/test/ui/parser/issue-17383.stderr @@ -1,5 +1,5 @@ error: discriminator values can only be used with a field-less enum - --> $DIR/issue-17383.rs:5:9 + --> $DIR/issue-17383.rs:3:9 | LL | b'a' //~ ERROR discriminator values can only be used with a field-less enum | ^^^^ diff --git a/src/test/ui/parser/issue-17718-const-mut.rs b/src/test/ui/parser/issue-17718-const-mut.rs index f9b8d3104d9..4e74516d6b6 100644 --- a/src/test/ui/parser/issue-17718-const-mut.rs +++ b/src/test/ui/parser/issue-17718-const-mut.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - const mut //~ ERROR: const globals cannot be mutable //~^ HELP did you mean to declare a static? diff --git a/src/test/ui/parser/issue-17718-const-mut.stderr b/src/test/ui/parser/issue-17718-const-mut.stderr index d54a57066b1..29a65ebe418 100644 --- a/src/test/ui/parser/issue-17718-const-mut.stderr +++ b/src/test/ui/parser/issue-17718-const-mut.stderr @@ -1,5 +1,5 @@ error: const globals cannot be mutable - --> $DIR/issue-17718-const-mut.rs:4:1 + --> $DIR/issue-17718-const-mut.rs:2:1 | LL | mut //~ ERROR: const globals cannot be mutable | ^^^ diff --git a/src/test/ui/parser/issue-17904-2.rs b/src/test/ui/parser/issue-17904-2.rs index 487abd30ebf..d3f32255c31 100644 --- a/src/test/ui/parser/issue-17904-2.rs +++ b/src/test/ui/parser/issue-17904-2.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error struct Bar { x: T } where T: Copy //~ ERROR expected item, found keyword `where` diff --git a/src/test/ui/parser/issue-17904.rs b/src/test/ui/parser/issue-17904.rs index 2fe897e46cc..6112623041a 100644 --- a/src/test/ui/parser/issue-17904.rs +++ b/src/test/ui/parser/issue-17904.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error struct Baz where U: Eq(U); //This is parsed as the new Fn* style parenthesis syntax. struct Baz where U: Eq(U) -> R; // Notice this parses as well. diff --git a/src/test/ui/parser/issue-1802-1.rs b/src/test/ui/parser/issue-1802-1.rs index 207298c363c..050e9a258d1 100644 --- a/src/test/ui/parser/issue-1802-1.rs +++ b/src/test/ui/parser/issue-1802-1.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern:no valid digits found for number fn main() { log(error, 0b); diff --git a/src/test/ui/parser/issue-1802-1.stderr b/src/test/ui/parser/issue-1802-1.stderr index b7d003df56b..5cd6a4f7c68 100644 --- a/src/test/ui/parser/issue-1802-1.stderr +++ b/src/test/ui/parser/issue-1802-1.stderr @@ -1,5 +1,5 @@ error: no valid digits found for number - --> $DIR/issue-1802-1.rs:5:16 + --> $DIR/issue-1802-1.rs:3:16 | LL | log(error, 0b); | ^^ diff --git a/src/test/ui/parser/issue-1802-2.rs b/src/test/ui/parser/issue-1802-2.rs index 28094ed4bea..796db66d22e 100644 --- a/src/test/ui/parser/issue-1802-2.rs +++ b/src/test/ui/parser/issue-1802-2.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern:no valid digits found for number fn main() { log(error, 0b_usize); diff --git a/src/test/ui/parser/issue-1802-2.stderr b/src/test/ui/parser/issue-1802-2.stderr index e57871ae688..c6c04279666 100644 --- a/src/test/ui/parser/issue-1802-2.stderr +++ b/src/test/ui/parser/issue-1802-2.stderr @@ -1,5 +1,5 @@ error: no valid digits found for number - --> $DIR/issue-1802-2.rs:5:16 + --> $DIR/issue-1802-2.rs:3:16 | LL | log(error, 0b_usize); | ^^^ diff --git a/src/test/ui/parser/issue-19096.rs b/src/test/ui/parser/issue-19096.rs index 8b682732f64..edc69e6f49f 100644 --- a/src/test/ui/parser/issue-19096.rs +++ b/src/test/ui/parser/issue-19096.rs @@ -1,6 +1,5 @@ -// compile-flags: -Z parse-only - fn main() { let t = (42, 42); t.0::; //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `::` + //~| ERROR mismatched types } diff --git a/src/test/ui/parser/issue-19096.stderr b/src/test/ui/parser/issue-19096.stderr index 922cfe07ac0..f92604d0067 100644 --- a/src/test/ui/parser/issue-19096.stderr +++ b/src/test/ui/parser/issue-19096.stderr @@ -1,8 +1,21 @@ error: expected one of `.`, `;`, `?`, `}`, or an operator, found `::` - --> $DIR/issue-19096.rs:5:8 + --> $DIR/issue-19096.rs:3:8 | LL | t.0::; //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `::` | ^^ expected one of `.`, `;`, `?`, `}`, or an operator here -error: aborting due to previous error +error[E0308]: mismatched types + --> $DIR/issue-19096.rs:3:5 + | +LL | fn main() { + | - expected `()` because of default return type +LL | let t = (42, 42); +LL | t.0::; //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `::` + | ^^^ expected (), found integer + | + = note: expected type `()` + found type `{integer}` +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/parser/issue-19398.rs b/src/test/ui/parser/issue-19398.rs index d31d31c8e12..822f4a6fde2 100644 --- a/src/test/ui/parser/issue-19398.rs +++ b/src/test/ui/parser/issue-19398.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - trait T { extern "Rust" unsafe fn foo(); //~ ERROR expected `fn`, found `unsafe` } diff --git a/src/test/ui/parser/issue-19398.stderr b/src/test/ui/parser/issue-19398.stderr index b9eabf0e3c0..627b74ff8f7 100644 --- a/src/test/ui/parser/issue-19398.stderr +++ b/src/test/ui/parser/issue-19398.stderr @@ -1,5 +1,5 @@ error: expected `fn`, found `unsafe` - --> $DIR/issue-19398.rs:4:19 + --> $DIR/issue-19398.rs:2:19 | LL | extern "Rust" unsafe fn foo(); //~ ERROR expected `fn`, found `unsafe` | ^^^^^^ expected `fn` here diff --git a/src/test/ui/parser/issue-20711-2.rs b/src/test/ui/parser/issue-20711-2.rs index e9f26cb3916..49b8de03c37 100644 --- a/src/test/ui/parser/issue-20711-2.rs +++ b/src/test/ui/parser/issue-20711-2.rs @@ -1,4 +1,3 @@ -// compile-flags: -Z parse-only // ignore-tidy-linelength struct Foo; diff --git a/src/test/ui/parser/issue-20711-2.stderr b/src/test/ui/parser/issue-20711-2.stderr index a677a7ea74b..e06eb7a9846 100644 --- a/src/test/ui/parser/issue-20711-2.stderr +++ b/src/test/ui/parser/issue-20711-2.stderr @@ -1,5 +1,5 @@ error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` - --> $DIR/issue-20711-2.rs:10:1 + --> $DIR/issue-20711-2.rs:9:1 | LL | #[stable(feature = "rust1", since = "1.0.0")] | - expected one of 10 possible tokens here diff --git a/src/test/ui/parser/issue-20711.rs b/src/test/ui/parser/issue-20711.rs index 545984706a2..8d8401da61a 100644 --- a/src/test/ui/parser/issue-20711.rs +++ b/src/test/ui/parser/issue-20711.rs @@ -1,4 +1,3 @@ -// compile-flags: -Z parse-only // ignore-tidy-linelength struct Foo; diff --git a/src/test/ui/parser/issue-20711.stderr b/src/test/ui/parser/issue-20711.stderr index da925b590a8..6cf39608fcc 100644 --- a/src/test/ui/parser/issue-20711.stderr +++ b/src/test/ui/parser/issue-20711.stderr @@ -1,5 +1,5 @@ error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` - --> $DIR/issue-20711.rs:8:1 + --> $DIR/issue-20711.rs:7:1 | LL | #[stable(feature = "rust1", since = "1.0.0")] | - expected one of 10 possible tokens here diff --git a/src/test/ui/parser/issue-21153.rs b/src/test/ui/parser/issue-21153.rs index 13a5cc320e5..46cd45f28b4 100644 --- a/src/test/ui/parser/issue-21153.rs +++ b/src/test/ui/parser/issue-21153.rs @@ -1,5 +1,5 @@ -// compile-flags: -Z parse-only - trait MyTrait: Iterator { //~ ERROR missing `fn`, `type`, or `const` Item = T; } + +fn main() {} diff --git a/src/test/ui/parser/issue-21153.stderr b/src/test/ui/parser/issue-21153.stderr index ae8b106f6a2..1e0244c2e1d 100644 --- a/src/test/ui/parser/issue-21153.stderr +++ b/src/test/ui/parser/issue-21153.stderr @@ -1,5 +1,5 @@ error: missing `fn`, `type`, or `const` for trait-item declaration - --> $DIR/issue-21153.rs:3:29 + --> $DIR/issue-21153.rs:1:29 | LL | trait MyTrait: Iterator { //~ ERROR missing `fn`, `type`, or `const` | _____________________________^ diff --git a/src/test/ui/parser/issue-22647.rs b/src/test/ui/parser/issue-22647.rs index 3b9bad2d1bf..25cd7ffce5a 100644 --- a/src/test/ui/parser/issue-22647.rs +++ b/src/test/ui/parser/issue-22647.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let caller = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<` where F: Fn() -> i32 diff --git a/src/test/ui/parser/issue-22647.stderr b/src/test/ui/parser/issue-22647.stderr index e8ae163314a..8935ea9c6c1 100644 --- a/src/test/ui/parser/issue-22647.stderr +++ b/src/test/ui/parser/issue-22647.stderr @@ -1,5 +1,5 @@ error: expected one of `:`, `;`, `=`, or `@`, found `<` - --> $DIR/issue-22647.rs:4:15 + --> $DIR/issue-22647.rs:2:15 | LL | let caller = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<` | ^ expected one of `:`, `;`, `=`, or `@` here diff --git a/src/test/ui/parser/issue-22712.rs b/src/test/ui/parser/issue-22712.rs index a34b2b5fea9..b03d578e3d6 100644 --- a/src/test/ui/parser/issue-22712.rs +++ b/src/test/ui/parser/issue-22712.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - struct Foo { buffer: B } diff --git a/src/test/ui/parser/issue-22712.stderr b/src/test/ui/parser/issue-22712.stderr index b668e4999de..3a4fa9a5e7b 100644 --- a/src/test/ui/parser/issue-22712.stderr +++ b/src/test/ui/parser/issue-22712.stderr @@ -1,5 +1,5 @@ error: expected one of `:`, `;`, `=`, or `@`, found `<` - --> $DIR/issue-22712.rs:8:12 + --> $DIR/issue-22712.rs:6:12 | LL | let Foo> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<` | ^ expected one of `:`, `;`, `=`, or `@` here diff --git a/src/test/ui/parser/issue-2354-1.rs b/src/test/ui/parser/issue-2354-1.rs index 50e166c1f36..7e4e24fae19 100644 --- a/src/test/ui/parser/issue-2354-1.rs +++ b/src/test/ui/parser/issue-2354-1.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - static foo: isize = 2; } //~ ERROR unexpected close delimiter: diff --git a/src/test/ui/parser/issue-2354-1.stderr b/src/test/ui/parser/issue-2354-1.stderr index 6ca5ff7344a..da25aac486e 100644 --- a/src/test/ui/parser/issue-2354-1.stderr +++ b/src/test/ui/parser/issue-2354-1.stderr @@ -1,5 +1,5 @@ error: unexpected close delimiter: `}` - --> $DIR/issue-2354-1.rs:3:24 + --> $DIR/issue-2354-1.rs:1:24 | LL | static foo: isize = 2; } //~ ERROR unexpected close delimiter: | ^ unexpected close delimiter diff --git a/src/test/ui/parser/issue-2354.rs b/src/test/ui/parser/issue-2354.rs index 19308e115e3..565f84822f7 100644 --- a/src/test/ui/parser/issue-2354.rs +++ b/src/test/ui/parser/issue-2354.rs @@ -1,7 +1,5 @@ -// compile-flags: -Z parse-only - fn foo() { //~ NOTE un-closed delimiter - match Some(x) { + match Some(10) { //~^ NOTE this delimiter might not be properly closed... Some(y) => { panic!(); } None => { panic!(); } @@ -13,4 +11,5 @@ fn bar() { while (i < 1000) {} } -fn main() {} //~ ERROR this file contains an un-closed delimiter +fn main() {} //~ NOTE here is a function named 'main' + //~ ERROR this file contains an un-closed delimiter diff --git a/src/test/ui/parser/issue-2354.stderr b/src/test/ui/parser/issue-2354.stderr index a41696884a3..0f4cd5724ce 100644 --- a/src/test/ui/parser/issue-2354.stderr +++ b/src/test/ui/parser/issue-2354.stderr @@ -1,16 +1,26 @@ error: this file contains an un-closed delimiter - --> $DIR/issue-2354.rs:16:66 + --> $DIR/issue-2354.rs:15:66 | LL | fn foo() { //~ NOTE un-closed delimiter | - un-closed delimiter -LL | match Some(x) { - | - this delimiter might not be properly closed... +LL | match Some(10) { + | - this delimiter might not be properly closed... ... LL | } | - ...as it matches this but it has different indentation ... -LL | fn main() {} //~ ERROR this file contains an un-closed delimiter +LL | //~ ERROR this file contains an un-closed delimiter | ^ -error: aborting due to previous error +error[E0601]: `main` function not found in crate `issue_2354` + | + = note: the main function must be defined at the crate level but you have one or more functions named 'main' that are not defined at the crate level. Either move the definition or attach the `#[main]` attribute to override this behavior. +note: here is a function named 'main' + --> $DIR/issue-2354.rs:14:1 + | +LL | fn main() {} //~ NOTE here is a function named 'main' + | ^^^^^^^^^^^^ +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/ui/parser/issue-23620-invalid-escapes.rs b/src/test/ui/parser/issue-23620-invalid-escapes.rs index f8a2f1cc7e6..b4b8f1fc0b0 100644 --- a/src/test/ui/parser/issue-23620-invalid-escapes.rs +++ b/src/test/ui/parser/issue-23620-invalid-escapes.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error fn main() { let _ = b"\u{a66e}"; diff --git a/src/test/ui/parser/issue-24197.rs b/src/test/ui/parser/issue-24197.rs index a5c2c0c4339..005ff9fa2e0 100644 --- a/src/test/ui/parser/issue-24197.rs +++ b/src/test/ui/parser/issue-24197.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[` } diff --git a/src/test/ui/parser/issue-24197.stderr b/src/test/ui/parser/issue-24197.stderr index 0f684ca508c..4e073d8c58a 100644 --- a/src/test/ui/parser/issue-24197.stderr +++ b/src/test/ui/parser/issue-24197.stderr @@ -1,5 +1,5 @@ error: expected one of `:`, `;`, `=`, or `@`, found `[` - --> $DIR/issue-24197.rs:4:12 + --> $DIR/issue-24197.rs:2:12 | LL | let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[` | ^ expected one of `:`, `;`, `=`, or `@` here diff --git a/src/test/ui/parser/issue-24375.rs b/src/test/ui/parser/issue-24375.rs index f8b5a64bb6f..1d128d33e4f 100644 --- a/src/test/ui/parser/issue-24375.rs +++ b/src/test/ui/parser/issue-24375.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - static tmp : [&'static str; 2] = ["hello", "he"]; fn main() { diff --git a/src/test/ui/parser/issue-24375.stderr b/src/test/ui/parser/issue-24375.stderr index 5a0244bb501..f773a7df4fe 100644 --- a/src/test/ui/parser/issue-24375.stderr +++ b/src/test/ui/parser/issue-24375.stderr @@ -1,5 +1,5 @@ error: expected one of `=>`, `@`, `if`, or `|`, found `[` - --> $DIR/issue-24375.rs:8:12 + --> $DIR/issue-24375.rs:6:12 | LL | tmp[0] => {} //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `[` | ^ expected one of `=>`, `@`, `if`, or `|` here diff --git a/src/test/ui/parser/issue-24780.rs b/src/test/ui/parser/issue-24780.rs index 58500ffe3dc..799cdd80222 100644 --- a/src/test/ui/parser/issue-24780.rs +++ b/src/test/ui/parser/issue-24780.rs @@ -1,8 +1,6 @@ // Verify that '>' is not both expected and found at the same time, as it used // to happen in #24780. For example, following should be an error: // expected one of ..., `>`, ... found `>` -// -// compile-flags: -Z parse-only fn foo() -> Vec> { //~^ ERROR expected one of `!`, `+`, `::`, `where`, or `{`, found `>` diff --git a/src/test/ui/parser/issue-24780.stderr b/src/test/ui/parser/issue-24780.stderr index b3e1a96a218..469c034795e 100644 --- a/src/test/ui/parser/issue-24780.stderr +++ b/src/test/ui/parser/issue-24780.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `+`, `::`, `where`, or `{`, found `>` - --> $DIR/issue-24780.rs:7:23 + --> $DIR/issue-24780.rs:5:23 | LL | fn foo() -> Vec> { | ^ expected one of `!`, `+`, `::`, `where`, or `{` here diff --git a/src/test/ui/parser/issue-27255.rs b/src/test/ui/parser/issue-27255.rs index 08674c7b9ae..c0ff331b8ba 100644 --- a/src/test/ui/parser/issue-27255.rs +++ b/src/test/ui/parser/issue-27255.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - impl A .. {} //~ ERROR fn main() {} diff --git a/src/test/ui/parser/issue-27255.stderr b/src/test/ui/parser/issue-27255.stderr index 2ad0bbfb177..6d09d82e34f 100644 --- a/src/test/ui/parser/issue-27255.stderr +++ b/src/test/ui/parser/issue-27255.stderr @@ -1,5 +1,5 @@ error: missing `for` in a trait impl - --> $DIR/issue-27255.rs:3:7 + --> $DIR/issue-27255.rs:1:7 | LL | impl A .. {} //~ ERROR | ^ diff --git a/src/test/ui/parser/issue-30318.rs b/src/test/ui/parser/issue-30318.rs index 5a44b3f712d..38e30de716d 100644 --- a/src/test/ui/parser/issue-30318.rs +++ b/src/test/ui/parser/issue-30318.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn foo() { } //! Misplaced comment... diff --git a/src/test/ui/parser/issue-30318.stderr b/src/test/ui/parser/issue-30318.stderr index 6d4638836b1..489451bb5dc 100644 --- a/src/test/ui/parser/issue-30318.stderr +++ b/src/test/ui/parser/issue-30318.stderr @@ -1,5 +1,5 @@ error: expected outer doc comment - --> $DIR/issue-30318.rs:5:1 + --> $DIR/issue-30318.rs:3:1 | LL | //! Misplaced comment... | ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/parser/issue-3036.rs b/src/test/ui/parser/issue-3036.rs index 66f4b5f097f..00b241b9054 100644 --- a/src/test/ui/parser/issue-3036.rs +++ b/src/test/ui/parser/issue-3036.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Testing that semicolon tokens are printed correctly in errors fn main() diff --git a/src/test/ui/parser/issue-3036.stderr b/src/test/ui/parser/issue-3036.stderr index 41905b0ec4d..eadf5546d85 100644 --- a/src/test/ui/parser/issue-3036.stderr +++ b/src/test/ui/parser/issue-3036.stderr @@ -1,5 +1,5 @@ error: expected one of `.`, `;`, `?`, or an operator, found `}` - --> $DIR/issue-3036.rs:8:1 + --> $DIR/issue-3036.rs:6:1 | LL | let x = 3 | - expected one of `.`, `;`, `?`, or an operator here diff --git a/src/test/ui/parser/issue-32214.rs b/src/test/ui/parser/issue-32214.rs index 2ca169949f8..7e55bc038e7 100644 --- a/src/test/ui/parser/issue-32214.rs +++ b/src/test/ui/parser/issue-32214.rs @@ -1,6 +1,8 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error -pub fn test >() {} +trait Trait { type Item; } + +pub fn test >() {} //~^ ERROR type parameters must be declared prior to associated type bindings fn main() { } diff --git a/src/test/ui/parser/issue-32214.stderr b/src/test/ui/parser/issue-32214.stderr index 96677be8323..a01517d016d 100644 --- a/src/test/ui/parser/issue-32214.stderr +++ b/src/test/ui/parser/issue-32214.stderr @@ -1,8 +1,8 @@ error: type parameters must be declared prior to associated type bindings - --> $DIR/issue-32214.rs:3:37 + --> $DIR/issue-32214.rs:5:34 | -LL | pub fn test >() {} - | ^ +LL | pub fn test >() {} + | ^ error: aborting due to previous error diff --git a/src/test/ui/parser/issue-32446.rs b/src/test/ui/parser/issue-32446.rs index 264ea351997..53e519a72a5 100644 --- a/src/test/ui/parser/issue-32446.rs +++ b/src/test/ui/parser/issue-32446.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() {} // This used to end up in an infite loop trying to bump past EOF. diff --git a/src/test/ui/parser/issue-32446.stderr b/src/test/ui/parser/issue-32446.stderr index 931bef3b0bb..07eafdde907 100644 --- a/src/test/ui/parser/issue-32446.stderr +++ b/src/test/ui/parser/issue-32446.stderr @@ -1,5 +1,5 @@ error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `...` - --> $DIR/issue-32446.rs:6:11 + --> $DIR/issue-32446.rs:4:11 | LL | trait T { ... } //~ ERROR | ^^^ expected one of 7 possible tokens here diff --git a/src/test/ui/parser/issue-32501.rs b/src/test/ui/parser/issue-32501.rs index 40ed0285d20..9c01a5c6d20 100644 --- a/src/test/ui/parser/issue-32501.rs +++ b/src/test/ui/parser/issue-32501.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let a = 0; let _b = 0; diff --git a/src/test/ui/parser/issue-32501.stderr b/src/test/ui/parser/issue-32501.stderr index f03be3d7112..d74c539abfe 100644 --- a/src/test/ui/parser/issue-32501.stderr +++ b/src/test/ui/parser/issue-32501.stderr @@ -1,5 +1,5 @@ error: expected identifier, found reserved identifier `_` - --> $DIR/issue-32501.rs:9:13 + --> $DIR/issue-32501.rs:7:13 | LL | let mut _ = 0; //~ ERROR expected identifier, found reserved identifier `_` | ^ expected identifier, found reserved identifier diff --git a/src/test/ui/parser/issue-32505.rs b/src/test/ui/parser/issue-32505.rs index 94fe70ddd8f..49e7a2f536f 100644 --- a/src/test/ui/parser/issue-32505.rs +++ b/src/test/ui/parser/issue-32505.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error pub fn test() { foo(|_|) //~ ERROR expected expression, found `)` diff --git a/src/test/ui/parser/issue-33262.rs b/src/test/ui/parser/issue-33262.rs index 72c75ce8ff5..3a612f95c03 100644 --- a/src/test/ui/parser/issue-33262.rs +++ b/src/test/ui/parser/issue-33262.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Issue #33262 pub fn main() { diff --git a/src/test/ui/parser/issue-33262.stderr b/src/test/ui/parser/issue-33262.stderr index 11cdf620e95..c2491df903b 100644 --- a/src/test/ui/parser/issue-33262.stderr +++ b/src/test/ui/parser/issue-33262.stderr @@ -1,5 +1,5 @@ error: expected type, found `{` - --> $DIR/issue-33262.rs:6:22 + --> $DIR/issue-33262.rs:4:22 | LL | for i in 0..a as { } | ^ diff --git a/src/test/ui/parser/issue-33413.rs b/src/test/ui/parser/issue-33413.rs index a25c7d262e3..2ec86958174 100644 --- a/src/test/ui/parser/issue-33413.rs +++ b/src/test/ui/parser/issue-33413.rs @@ -1,6 +1,8 @@ -// compile-flags: -Z parse-only +struct S; impl S { fn f(*, a: u8) -> u8 {} //~^ ERROR expected argument name, found `*` } + +fn main() {} diff --git a/src/test/ui/parser/issue-33455.rs b/src/test/ui/parser/issue-33455.rs index 162bd8e43b6..6dff63f5cf4 100644 --- a/src/test/ui/parser/issue-33455.rs +++ b/src/test/ui/parser/issue-33455.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.` diff --git a/src/test/ui/parser/issue-33455.stderr b/src/test/ui/parser/issue-33455.stderr index 70d48f85313..38d00a0ea0b 100644 --- a/src/test/ui/parser/issue-33455.stderr +++ b/src/test/ui/parser/issue-33455.stderr @@ -1,5 +1,5 @@ error: expected one of `::`, `;`, or `as`, found `.` - --> $DIR/issue-33455.rs:3:8 + --> $DIR/issue-33455.rs:1:8 | LL | use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.` | ^ expected one of `::`, `;`, or `as` here diff --git a/src/test/ui/parser/issue-41155.rs b/src/test/ui/parser/issue-41155.rs index 2f6202e07a1..3c24d2b447d 100644 --- a/src/test/ui/parser/issue-41155.rs +++ b/src/test/ui/parser/issue-41155.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only +struct S; impl S { pub diff --git a/src/test/ui/parser/issue-43692.rs b/src/test/ui/parser/issue-43692.rs index c34f55ec59b..baf8bafb8b7 100644 --- a/src/test/ui/parser/issue-43692.rs +++ b/src/test/ui/parser/issue-43692.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { '\u{_10FFFF}'; //~ ERROR invalid start of unicode escape } diff --git a/src/test/ui/parser/issue-43692.stderr b/src/test/ui/parser/issue-43692.stderr index f92f6a1534a..780f63a6638 100644 --- a/src/test/ui/parser/issue-43692.stderr +++ b/src/test/ui/parser/issue-43692.stderr @@ -1,5 +1,5 @@ error: invalid start of unicode escape - --> $DIR/issue-43692.rs:4:9 + --> $DIR/issue-43692.rs:2:9 | LL | '/u{_10FFFF}'; //~ ERROR invalid start of unicode escape | ^ diff --git a/src/test/ui/parser/issue-5544-a.rs b/src/test/ui/parser/issue-5544-a.rs index 72cc2227eb8..303b902c499 100644 --- a/src/test/ui/parser/issue-5544-a.rs +++ b/src/test/ui/parser/issue-5544-a.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let __isize = 340282366920938463463374607431768211456; // 2^128 //~^ ERROR int literal is too large diff --git a/src/test/ui/parser/issue-5544-a.stderr b/src/test/ui/parser/issue-5544-a.stderr index cd52da8a45c..bc48853b380 100644 --- a/src/test/ui/parser/issue-5544-a.stderr +++ b/src/test/ui/parser/issue-5544-a.stderr @@ -1,5 +1,5 @@ error: int literal is too large - --> $DIR/issue-5544-a.rs:4:19 + --> $DIR/issue-5544-a.rs:2:19 | LL | let __isize = 340282366920938463463374607431768211456; // 2^128 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/parser/issue-5544-b.rs b/src/test/ui/parser/issue-5544-b.rs index 9c87b61a78a..fa40f15dedb 100644 --- a/src/test/ui/parser/issue-5544-b.rs +++ b/src/test/ui/parser/issue-5544-b.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let __isize = 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff; //~^ ERROR int literal is too large diff --git a/src/test/ui/parser/issue-5544-b.stderr b/src/test/ui/parser/issue-5544-b.stderr index 835887f5520..3f15c0c0d75 100644 --- a/src/test/ui/parser/issue-5544-b.stderr +++ b/src/test/ui/parser/issue-5544-b.stderr @@ -1,5 +1,5 @@ error: int literal is too large - --> $DIR/issue-5544-b.rs:4:19 + --> $DIR/issue-5544-b.rs:2:19 | LL | let __isize = 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/parser/issue-5806.rs b/src/test/ui/parser/issue-5806.rs index 298247e2e7f..b694642a9c5 100644 --- a/src/test/ui/parser/issue-5806.rs +++ b/src/test/ui/parser/issue-5806.rs @@ -1,4 +1,3 @@ -// compile-flags: -Z parse-only // normalize-stderr-test: "parser:.*\(" -> "parser: $$ACCESS_DENIED_MSG (" // normalize-stderr-test: "os error \d+" -> "os error $$ACCESS_DENIED_CODE" diff --git a/src/test/ui/parser/issue-5806.stderr b/src/test/ui/parser/issue-5806.stderr index 5c67bbaa62c..f9f00f70f0b 100644 --- a/src/test/ui/parser/issue-5806.stderr +++ b/src/test/ui/parser/issue-5806.stderr @@ -1,5 +1,5 @@ error: couldn't read $DIR/../parser: $ACCESS_DENIED_MSG (os error $ACCESS_DENIED_CODE) - --> $DIR/issue-5806.rs:6:5 + --> $DIR/issue-5806.rs:5:5 | LL | mod foo; //~ ERROR couldn't read | ^^^ diff --git a/src/test/ui/parser/issue-6610.rs b/src/test/ui/parser/issue-6610.rs index d2e4d3861fb..2dfa08fe82d 100644 --- a/src/test/ui/parser/issue-6610.rs +++ b/src/test/ui/parser/issue-6610.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - trait Foo { fn a() } //~ ERROR expected `;` or `{`, found `}` fn main() {} diff --git a/src/test/ui/parser/issue-6610.stderr b/src/test/ui/parser/issue-6610.stderr index 5814e8037e9..b4760161a62 100644 --- a/src/test/ui/parser/issue-6610.stderr +++ b/src/test/ui/parser/issue-6610.stderr @@ -1,5 +1,5 @@ error: expected `;` or `{`, found `}` - --> $DIR/issue-6610.rs:3:20 + --> $DIR/issue-6610.rs:1:20 | LL | trait Foo { fn a() } //~ ERROR expected `;` or `{`, found `}` | ^ expected `;` or `{` diff --git a/src/test/ui/parser/issue-8537.rs b/src/test/ui/parser/issue-8537.rs index 387cf993970..9d0cbce6c8a 100644 --- a/src/test/ui/parser/issue-8537.rs +++ b/src/test/ui/parser/issue-8537.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - pub extern "invalid-ab_isize" //~ ERROR invalid ABI fn foo() {} diff --git a/src/test/ui/parser/issue-8537.stderr b/src/test/ui/parser/issue-8537.stderr index 7b3d3b2b7c5..4442cd0ff01 100644 --- a/src/test/ui/parser/issue-8537.stderr +++ b/src/test/ui/parser/issue-8537.stderr @@ -1,5 +1,5 @@ error[E0703]: invalid ABI: found `invalid-ab_isize` - --> $DIR/issue-8537.rs:4:3 + --> $DIR/issue-8537.rs:2:3 | LL | "invalid-ab_isize" //~ ERROR invalid ABI | ^^^^^^^^^^^^^^^^^^ invalid ABI diff --git a/src/test/ui/parser/keyword-abstract.rs b/src/test/ui/parser/keyword-abstract.rs index 14f92eeb08e..890802ac134 100644 --- a/src/test/ui/parser/keyword-abstract.rs +++ b/src/test/ui/parser/keyword-abstract.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let abstract = (); //~ ERROR expected pattern, found reserved keyword `abstract` } diff --git a/src/test/ui/parser/keyword-abstract.stderr b/src/test/ui/parser/keyword-abstract.stderr index 3f94b31bd71..4185ae034b5 100644 --- a/src/test/ui/parser/keyword-abstract.stderr +++ b/src/test/ui/parser/keyword-abstract.stderr @@ -1,5 +1,5 @@ error: expected pattern, found reserved keyword `abstract` - --> $DIR/keyword-abstract.rs:4:9 + --> $DIR/keyword-abstract.rs:2:9 | LL | let abstract = (); //~ ERROR expected pattern, found reserved keyword `abstract` | ^^^^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-as-as-identifier.rs b/src/test/ui/parser/keyword-as-as-identifier.rs index d2a38a41aa6..23ff259db30 100644 --- a/src/test/ui/parser/keyword-as-as-identifier.rs +++ b/src/test/ui/parser/keyword-as-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py as' fn main() { diff --git a/src/test/ui/parser/keyword-as-as-identifier.stderr b/src/test/ui/parser/keyword-as-as-identifier.stderr index c14dfc48df4..6eaf5e2ed93 100644 --- a/src/test/ui/parser/keyword-as-as-identifier.stderr +++ b/src/test/ui/parser/keyword-as-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `as` - --> $DIR/keyword-as-as-identifier.rs:6:9 + --> $DIR/keyword-as-as-identifier.rs:4:9 | LL | let as = "foo"; //~ error: expected pattern, found keyword `as` | ^^ expected pattern diff --git a/src/test/ui/parser/keyword-box-as-identifier.rs b/src/test/ui/parser/keyword-box-as-identifier.rs index acbd4a8c92c..33961bb3084 100644 --- a/src/test/ui/parser/keyword-box-as-identifier.rs +++ b/src/test/ui/parser/keyword-box-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let box = "foo"; //~ error: expected pattern, found `=` } diff --git a/src/test/ui/parser/keyword-box-as-identifier.stderr b/src/test/ui/parser/keyword-box-as-identifier.stderr index 5e1ad39c160..07a134442b8 100644 --- a/src/test/ui/parser/keyword-box-as-identifier.stderr +++ b/src/test/ui/parser/keyword-box-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found `=` - --> $DIR/keyword-box-as-identifier.rs:4:13 + --> $DIR/keyword-box-as-identifier.rs:2:13 | LL | let box = "foo"; //~ error: expected pattern, found `=` | ^ expected pattern diff --git a/src/test/ui/parser/keyword-break-as-identifier.rs b/src/test/ui/parser/keyword-break-as-identifier.rs index 02affe09c6b..5ee111d38c9 100644 --- a/src/test/ui/parser/keyword-break-as-identifier.rs +++ b/src/test/ui/parser/keyword-break-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py break' fn main() { diff --git a/src/test/ui/parser/keyword-break-as-identifier.stderr b/src/test/ui/parser/keyword-break-as-identifier.stderr index 6e17e34df88..69af9737445 100644 --- a/src/test/ui/parser/keyword-break-as-identifier.stderr +++ b/src/test/ui/parser/keyword-break-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `break` - --> $DIR/keyword-break-as-identifier.rs:6:9 + --> $DIR/keyword-break-as-identifier.rs:4:9 | LL | let break = "foo"; //~ error: expected pattern, found keyword `break` | ^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-const-as-identifier.rs b/src/test/ui/parser/keyword-const-as-identifier.rs index cd86858716e..48fc142cf64 100644 --- a/src/test/ui/parser/keyword-const-as-identifier.rs +++ b/src/test/ui/parser/keyword-const-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py const' fn main() { diff --git a/src/test/ui/parser/keyword-const-as-identifier.stderr b/src/test/ui/parser/keyword-const-as-identifier.stderr index c3a42382aa5..c727f1754c7 100644 --- a/src/test/ui/parser/keyword-const-as-identifier.stderr +++ b/src/test/ui/parser/keyword-const-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `const` - --> $DIR/keyword-const-as-identifier.rs:6:9 + --> $DIR/keyword-const-as-identifier.rs:4:9 | LL | let const = "foo"; //~ error: expected pattern, found keyword `const` | ^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-continue-as-identifier.rs b/src/test/ui/parser/keyword-continue-as-identifier.rs index 58683a3d006..06315a48349 100644 --- a/src/test/ui/parser/keyword-continue-as-identifier.rs +++ b/src/test/ui/parser/keyword-continue-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py continue' fn main() { diff --git a/src/test/ui/parser/keyword-continue-as-identifier.stderr b/src/test/ui/parser/keyword-continue-as-identifier.stderr index d26e524c153..7fd2761884f 100644 --- a/src/test/ui/parser/keyword-continue-as-identifier.stderr +++ b/src/test/ui/parser/keyword-continue-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `continue` - --> $DIR/keyword-continue-as-identifier.rs:6:9 + --> $DIR/keyword-continue-as-identifier.rs:4:9 | LL | let continue = "foo"; //~ error: expected pattern, found keyword `continue` | ^^^^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-else-as-identifier.rs b/src/test/ui/parser/keyword-else-as-identifier.rs index 61e64c7e148..0c69105cf94 100644 --- a/src/test/ui/parser/keyword-else-as-identifier.rs +++ b/src/test/ui/parser/keyword-else-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py else' fn main() { diff --git a/src/test/ui/parser/keyword-else-as-identifier.stderr b/src/test/ui/parser/keyword-else-as-identifier.stderr index cdb8cb7d3d7..6d180bb56da 100644 --- a/src/test/ui/parser/keyword-else-as-identifier.stderr +++ b/src/test/ui/parser/keyword-else-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `else` - --> $DIR/keyword-else-as-identifier.rs:6:9 + --> $DIR/keyword-else-as-identifier.rs:4:9 | LL | let else = "foo"; //~ error: expected pattern, found keyword `else` | ^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-enum-as-identifier.rs b/src/test/ui/parser/keyword-enum-as-identifier.rs index 2fb1a6d341c..d1675800a27 100644 --- a/src/test/ui/parser/keyword-enum-as-identifier.rs +++ b/src/test/ui/parser/keyword-enum-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py enum' fn main() { diff --git a/src/test/ui/parser/keyword-enum-as-identifier.stderr b/src/test/ui/parser/keyword-enum-as-identifier.stderr index 3c247f7f6d2..dc7e37824dc 100644 --- a/src/test/ui/parser/keyword-enum-as-identifier.stderr +++ b/src/test/ui/parser/keyword-enum-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `enum` - --> $DIR/keyword-enum-as-identifier.rs:6:9 + --> $DIR/keyword-enum-as-identifier.rs:4:9 | LL | let enum = "foo"; //~ error: expected pattern, found keyword `enum` | ^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-final.rs b/src/test/ui/parser/keyword-final.rs index 7350f5a7f3e..e1cecd0e8e0 100644 --- a/src/test/ui/parser/keyword-final.rs +++ b/src/test/ui/parser/keyword-final.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let final = (); //~ ERROR expected pattern, found reserved keyword `final` } diff --git a/src/test/ui/parser/keyword-final.stderr b/src/test/ui/parser/keyword-final.stderr index ab85d73275d..897624279e5 100644 --- a/src/test/ui/parser/keyword-final.stderr +++ b/src/test/ui/parser/keyword-final.stderr @@ -1,5 +1,5 @@ error: expected pattern, found reserved keyword `final` - --> $DIR/keyword-final.rs:4:9 + --> $DIR/keyword-final.rs:2:9 | LL | let final = (); //~ ERROR expected pattern, found reserved keyword `final` | ^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-fn-as-identifier.rs b/src/test/ui/parser/keyword-fn-as-identifier.rs index dfeb444ccfd..bca2d5996a5 100644 --- a/src/test/ui/parser/keyword-fn-as-identifier.rs +++ b/src/test/ui/parser/keyword-fn-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py fn' fn main() { diff --git a/src/test/ui/parser/keyword-fn-as-identifier.stderr b/src/test/ui/parser/keyword-fn-as-identifier.stderr index c1297ca31d3..945fc77c310 100644 --- a/src/test/ui/parser/keyword-fn-as-identifier.stderr +++ b/src/test/ui/parser/keyword-fn-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `fn` - --> $DIR/keyword-fn-as-identifier.rs:6:9 + --> $DIR/keyword-fn-as-identifier.rs:4:9 | LL | let fn = "foo"; //~ error: expected pattern, found keyword `fn` | ^^ expected pattern diff --git a/src/test/ui/parser/keyword-for-as-identifier.rs b/src/test/ui/parser/keyword-for-as-identifier.rs index 806156f26a3..ce49fd90d91 100644 --- a/src/test/ui/parser/keyword-for-as-identifier.rs +++ b/src/test/ui/parser/keyword-for-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py for' fn main() { diff --git a/src/test/ui/parser/keyword-for-as-identifier.stderr b/src/test/ui/parser/keyword-for-as-identifier.stderr index ae081dc4cec..32263e9f6e2 100644 --- a/src/test/ui/parser/keyword-for-as-identifier.stderr +++ b/src/test/ui/parser/keyword-for-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `for` - --> $DIR/keyword-for-as-identifier.rs:6:9 + --> $DIR/keyword-for-as-identifier.rs:4:9 | LL | let for = "foo"; //~ error: expected pattern, found keyword `for` | ^^^ expected pattern diff --git a/src/test/ui/parser/keyword-if-as-identifier.rs b/src/test/ui/parser/keyword-if-as-identifier.rs index d71b77f7203..a1302970689 100644 --- a/src/test/ui/parser/keyword-if-as-identifier.rs +++ b/src/test/ui/parser/keyword-if-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py if' fn main() { diff --git a/src/test/ui/parser/keyword-if-as-identifier.stderr b/src/test/ui/parser/keyword-if-as-identifier.stderr index 7eaab1230b4..11ba41015cb 100644 --- a/src/test/ui/parser/keyword-if-as-identifier.stderr +++ b/src/test/ui/parser/keyword-if-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `if` - --> $DIR/keyword-if-as-identifier.rs:6:9 + --> $DIR/keyword-if-as-identifier.rs:4:9 | LL | let if = "foo"; //~ error: expected pattern, found keyword `if` | ^^ expected pattern diff --git a/src/test/ui/parser/keyword-impl-as-identifier.rs b/src/test/ui/parser/keyword-impl-as-identifier.rs index a151b089e66..95a34483ad2 100644 --- a/src/test/ui/parser/keyword-impl-as-identifier.rs +++ b/src/test/ui/parser/keyword-impl-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py impl' fn main() { diff --git a/src/test/ui/parser/keyword-impl-as-identifier.stderr b/src/test/ui/parser/keyword-impl-as-identifier.stderr index 97442a228e7..960a42df429 100644 --- a/src/test/ui/parser/keyword-impl-as-identifier.stderr +++ b/src/test/ui/parser/keyword-impl-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `impl` - --> $DIR/keyword-impl-as-identifier.rs:6:9 + --> $DIR/keyword-impl-as-identifier.rs:4:9 | LL | let impl = "foo"; //~ error: expected pattern, found keyword `impl` | ^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-in-as-identifier.rs b/src/test/ui/parser/keyword-in-as-identifier.rs index 4cd0d88cf9f..e4499dea255 100644 --- a/src/test/ui/parser/keyword-in-as-identifier.rs +++ b/src/test/ui/parser/keyword-in-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py in' fn main() { diff --git a/src/test/ui/parser/keyword-in-as-identifier.stderr b/src/test/ui/parser/keyword-in-as-identifier.stderr index c776aa499da..2300a257a02 100644 --- a/src/test/ui/parser/keyword-in-as-identifier.stderr +++ b/src/test/ui/parser/keyword-in-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `in` - --> $DIR/keyword-in-as-identifier.rs:6:9 + --> $DIR/keyword-in-as-identifier.rs:4:9 | LL | let in = "foo"; //~ error: expected pattern, found keyword `in` | ^^ expected pattern diff --git a/src/test/ui/parser/keyword-let-as-identifier.rs b/src/test/ui/parser/keyword-let-as-identifier.rs index 690a6bd700d..07c0ddf8ce5 100644 --- a/src/test/ui/parser/keyword-let-as-identifier.rs +++ b/src/test/ui/parser/keyword-let-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py let' fn main() { diff --git a/src/test/ui/parser/keyword-let-as-identifier.stderr b/src/test/ui/parser/keyword-let-as-identifier.stderr index 1c05bb864b8..ed2c8a4eb9c 100644 --- a/src/test/ui/parser/keyword-let-as-identifier.stderr +++ b/src/test/ui/parser/keyword-let-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `let` - --> $DIR/keyword-let-as-identifier.rs:6:9 + --> $DIR/keyword-let-as-identifier.rs:4:9 | LL | let let = "foo"; //~ error: expected pattern, found keyword `let` | ^^^ expected pattern diff --git a/src/test/ui/parser/keyword-loop-as-identifier.rs b/src/test/ui/parser/keyword-loop-as-identifier.rs index 9be7373cf11..8643ffe4345 100644 --- a/src/test/ui/parser/keyword-loop-as-identifier.rs +++ b/src/test/ui/parser/keyword-loop-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py loop' fn main() { diff --git a/src/test/ui/parser/keyword-loop-as-identifier.stderr b/src/test/ui/parser/keyword-loop-as-identifier.stderr index 9168fbb5151..f91cab02953 100644 --- a/src/test/ui/parser/keyword-loop-as-identifier.stderr +++ b/src/test/ui/parser/keyword-loop-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `loop` - --> $DIR/keyword-loop-as-identifier.rs:6:9 + --> $DIR/keyword-loop-as-identifier.rs:4:9 | LL | let loop = "foo"; //~ error: expected pattern, found keyword `loop` | ^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-match-as-identifier.rs b/src/test/ui/parser/keyword-match-as-identifier.rs index 02a0d754c6e..8ef6b6810a5 100644 --- a/src/test/ui/parser/keyword-match-as-identifier.rs +++ b/src/test/ui/parser/keyword-match-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py match' fn main() { diff --git a/src/test/ui/parser/keyword-match-as-identifier.stderr b/src/test/ui/parser/keyword-match-as-identifier.stderr index 5a3cc7f904d..4c8e76695bc 100644 --- a/src/test/ui/parser/keyword-match-as-identifier.stderr +++ b/src/test/ui/parser/keyword-match-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `match` - --> $DIR/keyword-match-as-identifier.rs:6:9 + --> $DIR/keyword-match-as-identifier.rs:4:9 | LL | let match = "foo"; //~ error: expected pattern, found keyword `match` | ^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-mod-as-identifier.rs b/src/test/ui/parser/keyword-mod-as-identifier.rs index 1f9ffc82da4..96bcdccf0a0 100644 --- a/src/test/ui/parser/keyword-mod-as-identifier.rs +++ b/src/test/ui/parser/keyword-mod-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py mod' fn main() { diff --git a/src/test/ui/parser/keyword-mod-as-identifier.stderr b/src/test/ui/parser/keyword-mod-as-identifier.stderr index 89b73193208..8aeebcebec9 100644 --- a/src/test/ui/parser/keyword-mod-as-identifier.stderr +++ b/src/test/ui/parser/keyword-mod-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `mod` - --> $DIR/keyword-mod-as-identifier.rs:6:9 + --> $DIR/keyword-mod-as-identifier.rs:4:9 | LL | let mod = "foo"; //~ error: expected pattern, found keyword `mod` | ^^^ expected pattern diff --git a/src/test/ui/parser/keyword-move-as-identifier.rs b/src/test/ui/parser/keyword-move-as-identifier.rs index 7b7e3508dca..2193af530bd 100644 --- a/src/test/ui/parser/keyword-move-as-identifier.rs +++ b/src/test/ui/parser/keyword-move-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py move' fn main() { diff --git a/src/test/ui/parser/keyword-move-as-identifier.stderr b/src/test/ui/parser/keyword-move-as-identifier.stderr index daabaced67a..37e06708e25 100644 --- a/src/test/ui/parser/keyword-move-as-identifier.stderr +++ b/src/test/ui/parser/keyword-move-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `move` - --> $DIR/keyword-move-as-identifier.rs:6:9 + --> $DIR/keyword-move-as-identifier.rs:4:9 | LL | let move = "foo"; //~ error: expected pattern, found keyword `move` | ^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-mut-as-identifier.rs b/src/test/ui/parser/keyword-mut-as-identifier.rs index 41b86b0229f..9b919d2b383 100644 --- a/src/test/ui/parser/keyword-mut-as-identifier.rs +++ b/src/test/ui/parser/keyword-mut-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let mut = "foo"; //~ error: expected identifier, found `=` } diff --git a/src/test/ui/parser/keyword-mut-as-identifier.stderr b/src/test/ui/parser/keyword-mut-as-identifier.stderr index c3a4525032c..b0266060903 100644 --- a/src/test/ui/parser/keyword-mut-as-identifier.stderr +++ b/src/test/ui/parser/keyword-mut-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected identifier, found `=` - --> $DIR/keyword-mut-as-identifier.rs:4:13 + --> $DIR/keyword-mut-as-identifier.rs:2:13 | LL | let mut = "foo"; //~ error: expected identifier, found `=` | ^ expected identifier diff --git a/src/test/ui/parser/keyword-override.rs b/src/test/ui/parser/keyword-override.rs index 423fbaf2a22..948a20095f1 100644 --- a/src/test/ui/parser/keyword-override.rs +++ b/src/test/ui/parser/keyword-override.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let override = (); //~ ERROR expected pattern, found reserved keyword `override` } diff --git a/src/test/ui/parser/keyword-override.stderr b/src/test/ui/parser/keyword-override.stderr index 03e6b399900..69a6415908c 100644 --- a/src/test/ui/parser/keyword-override.stderr +++ b/src/test/ui/parser/keyword-override.stderr @@ -1,5 +1,5 @@ error: expected pattern, found reserved keyword `override` - --> $DIR/keyword-override.rs:4:9 + --> $DIR/keyword-override.rs:2:9 | LL | let override = (); //~ ERROR expected pattern, found reserved keyword `override` | ^^^^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-pub-as-identifier.rs b/src/test/ui/parser/keyword-pub-as-identifier.rs index 6e5d84c5b0c..2ed8cc6b268 100644 --- a/src/test/ui/parser/keyword-pub-as-identifier.rs +++ b/src/test/ui/parser/keyword-pub-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py pub' fn main() { diff --git a/src/test/ui/parser/keyword-pub-as-identifier.stderr b/src/test/ui/parser/keyword-pub-as-identifier.stderr index 9353914d247..8b595673ec4 100644 --- a/src/test/ui/parser/keyword-pub-as-identifier.stderr +++ b/src/test/ui/parser/keyword-pub-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `pub` - --> $DIR/keyword-pub-as-identifier.rs:6:9 + --> $DIR/keyword-pub-as-identifier.rs:4:9 | LL | let pub = "foo"; //~ error: expected pattern, found keyword `pub` | ^^^ expected pattern diff --git a/src/test/ui/parser/keyword-ref-as-identifier.rs b/src/test/ui/parser/keyword-ref-as-identifier.rs index fc2a98af515..f5e04b5db73 100644 --- a/src/test/ui/parser/keyword-ref-as-identifier.rs +++ b/src/test/ui/parser/keyword-ref-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let ref = "foo"; //~ error: expected identifier, found `=` } diff --git a/src/test/ui/parser/keyword-ref-as-identifier.stderr b/src/test/ui/parser/keyword-ref-as-identifier.stderr index f5805bfbff9..656df196f09 100644 --- a/src/test/ui/parser/keyword-ref-as-identifier.stderr +++ b/src/test/ui/parser/keyword-ref-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected identifier, found `=` - --> $DIR/keyword-ref-as-identifier.rs:4:13 + --> $DIR/keyword-ref-as-identifier.rs:2:13 | LL | let ref = "foo"; //~ error: expected identifier, found `=` | ^ expected identifier diff --git a/src/test/ui/parser/keyword-return-as-identifier.rs b/src/test/ui/parser/keyword-return-as-identifier.rs index e85e818e925..920931b00f9 100644 --- a/src/test/ui/parser/keyword-return-as-identifier.rs +++ b/src/test/ui/parser/keyword-return-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py return' fn main() { diff --git a/src/test/ui/parser/keyword-return-as-identifier.stderr b/src/test/ui/parser/keyword-return-as-identifier.stderr index f6596326e6b..903137542d6 100644 --- a/src/test/ui/parser/keyword-return-as-identifier.stderr +++ b/src/test/ui/parser/keyword-return-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `return` - --> $DIR/keyword-return-as-identifier.rs:6:9 + --> $DIR/keyword-return-as-identifier.rs:4:9 | LL | let return = "foo"; //~ error: expected pattern, found keyword `return` | ^^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-static-as-identifier.rs b/src/test/ui/parser/keyword-static-as-identifier.rs index ae55d30ee4b..3ccbfccfc93 100644 --- a/src/test/ui/parser/keyword-static-as-identifier.rs +++ b/src/test/ui/parser/keyword-static-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py static' fn main() { diff --git a/src/test/ui/parser/keyword-static-as-identifier.stderr b/src/test/ui/parser/keyword-static-as-identifier.stderr index 23f4325d8b1..4830e6f1bef 100644 --- a/src/test/ui/parser/keyword-static-as-identifier.stderr +++ b/src/test/ui/parser/keyword-static-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `static` - --> $DIR/keyword-static-as-identifier.rs:6:9 + --> $DIR/keyword-static-as-identifier.rs:4:9 | LL | let static = "foo"; //~ error: expected pattern, found keyword `static` | ^^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-struct-as-identifier.rs b/src/test/ui/parser/keyword-struct-as-identifier.rs index 593db01ba83..69d8f190655 100644 --- a/src/test/ui/parser/keyword-struct-as-identifier.rs +++ b/src/test/ui/parser/keyword-struct-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py struct' fn main() { diff --git a/src/test/ui/parser/keyword-struct-as-identifier.stderr b/src/test/ui/parser/keyword-struct-as-identifier.stderr index a700116cc87..50ac690e425 100644 --- a/src/test/ui/parser/keyword-struct-as-identifier.stderr +++ b/src/test/ui/parser/keyword-struct-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `struct` - --> $DIR/keyword-struct-as-identifier.rs:6:9 + --> $DIR/keyword-struct-as-identifier.rs:4:9 | LL | let struct = "foo"; //~ error: expected pattern, found keyword `struct` | ^^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-trait-as-identifier.rs b/src/test/ui/parser/keyword-trait-as-identifier.rs index c53cf2f84f9..f62858442d2 100644 --- a/src/test/ui/parser/keyword-trait-as-identifier.rs +++ b/src/test/ui/parser/keyword-trait-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py trait' fn main() { diff --git a/src/test/ui/parser/keyword-trait-as-identifier.stderr b/src/test/ui/parser/keyword-trait-as-identifier.stderr index d96b465096f..3736f366cbd 100644 --- a/src/test/ui/parser/keyword-trait-as-identifier.stderr +++ b/src/test/ui/parser/keyword-trait-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `trait` - --> $DIR/keyword-trait-as-identifier.rs:6:9 + --> $DIR/keyword-trait-as-identifier.rs:4:9 | LL | let trait = "foo"; //~ error: expected pattern, found keyword `trait` | ^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-try-as-identifier-edition2018.rs b/src/test/ui/parser/keyword-try-as-identifier-edition2018.rs index a2782d42cf3..13a938b2e09 100644 --- a/src/test/ui/parser/keyword-try-as-identifier-edition2018.rs +++ b/src/test/ui/parser/keyword-try-as-identifier-edition2018.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only --edition 2018 +// compile-flags: --edition 2018 fn main() { let try = "foo"; //~ error: expected pattern, found reserved keyword `try` diff --git a/src/test/ui/parser/keyword-type-as-identifier.rs b/src/test/ui/parser/keyword-type-as-identifier.rs index 16395584314..992547e6f59 100644 --- a/src/test/ui/parser/keyword-type-as-identifier.rs +++ b/src/test/ui/parser/keyword-type-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py type' fn main() { diff --git a/src/test/ui/parser/keyword-type-as-identifier.stderr b/src/test/ui/parser/keyword-type-as-identifier.stderr index 13ffbec81b7..f7db20034a1 100644 --- a/src/test/ui/parser/keyword-type-as-identifier.stderr +++ b/src/test/ui/parser/keyword-type-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `type` - --> $DIR/keyword-type-as-identifier.rs:6:9 + --> $DIR/keyword-type-as-identifier.rs:4:9 | LL | let type = "foo"; //~ error: expected pattern, found keyword `type` | ^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-typeof.rs b/src/test/ui/parser/keyword-typeof.rs index 667caf18563..4ef102646ef 100644 --- a/src/test/ui/parser/keyword-typeof.rs +++ b/src/test/ui/parser/keyword-typeof.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let typeof = (); //~ ERROR expected pattern, found reserved keyword `typeof` } diff --git a/src/test/ui/parser/keyword-typeof.stderr b/src/test/ui/parser/keyword-typeof.stderr index feedd63fde8..07c9f883b60 100644 --- a/src/test/ui/parser/keyword-typeof.stderr +++ b/src/test/ui/parser/keyword-typeof.stderr @@ -1,5 +1,5 @@ error: expected pattern, found reserved keyword `typeof` - --> $DIR/keyword-typeof.rs:4:9 + --> $DIR/keyword-typeof.rs:2:9 | LL | let typeof = (); //~ ERROR expected pattern, found reserved keyword `typeof` | ^^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-unsafe-as-identifier.rs b/src/test/ui/parser/keyword-unsafe-as-identifier.rs index d3530a3bfb4..adb20ebe48c 100644 --- a/src/test/ui/parser/keyword-unsafe-as-identifier.rs +++ b/src/test/ui/parser/keyword-unsafe-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py unsafe' fn main() { diff --git a/src/test/ui/parser/keyword-unsafe-as-identifier.stderr b/src/test/ui/parser/keyword-unsafe-as-identifier.stderr index b7c0cfd83b7..ddd5e4d7b11 100644 --- a/src/test/ui/parser/keyword-unsafe-as-identifier.stderr +++ b/src/test/ui/parser/keyword-unsafe-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `unsafe` - --> $DIR/keyword-unsafe-as-identifier.rs:6:9 + --> $DIR/keyword-unsafe-as-identifier.rs:4:9 | LL | let unsafe = "foo"; //~ error: expected pattern, found keyword `unsafe` | ^^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-use-as-identifier.rs b/src/test/ui/parser/keyword-use-as-identifier.rs index 08c69e49124..198444bafc5 100644 --- a/src/test/ui/parser/keyword-use-as-identifier.rs +++ b/src/test/ui/parser/keyword-use-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py use' fn main() { diff --git a/src/test/ui/parser/keyword-use-as-identifier.stderr b/src/test/ui/parser/keyword-use-as-identifier.stderr index a2896ca7f33..7e798a3f0b9 100644 --- a/src/test/ui/parser/keyword-use-as-identifier.stderr +++ b/src/test/ui/parser/keyword-use-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `use` - --> $DIR/keyword-use-as-identifier.rs:6:9 + --> $DIR/keyword-use-as-identifier.rs:4:9 | LL | let use = "foo"; //~ error: expected pattern, found keyword `use` | ^^^ expected pattern diff --git a/src/test/ui/parser/keyword-where-as-identifier.rs b/src/test/ui/parser/keyword-where-as-identifier.rs index 8283cf5c31c..5624a8fc460 100644 --- a/src/test/ui/parser/keyword-where-as-identifier.rs +++ b/src/test/ui/parser/keyword-where-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py where' fn main() { diff --git a/src/test/ui/parser/keyword-where-as-identifier.stderr b/src/test/ui/parser/keyword-where-as-identifier.stderr index 3807084146d..5285520cc20 100644 --- a/src/test/ui/parser/keyword-where-as-identifier.stderr +++ b/src/test/ui/parser/keyword-where-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `where` - --> $DIR/keyword-where-as-identifier.rs:6:9 + --> $DIR/keyword-where-as-identifier.rs:4:9 | LL | let where = "foo"; //~ error: expected pattern, found keyword `where` | ^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword-while-as-identifier.rs b/src/test/ui/parser/keyword-while-as-identifier.rs index 7c70087a441..c0a539d3507 100644 --- a/src/test/ui/parser/keyword-while-as-identifier.rs +++ b/src/test/ui/parser/keyword-while-as-identifier.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // This file was auto-generated using 'src/etc/generate-keyword-tests.py while' fn main() { diff --git a/src/test/ui/parser/keyword-while-as-identifier.stderr b/src/test/ui/parser/keyword-while-as-identifier.stderr index eac17debf81..b84a652dc5c 100644 --- a/src/test/ui/parser/keyword-while-as-identifier.stderr +++ b/src/test/ui/parser/keyword-while-as-identifier.stderr @@ -1,5 +1,5 @@ error: expected pattern, found keyword `while` - --> $DIR/keyword-while-as-identifier.rs:6:9 + --> $DIR/keyword-while-as-identifier.rs:4:9 | LL | let while = "foo"; //~ error: expected pattern, found keyword `while` | ^^^^^ expected pattern diff --git a/src/test/ui/parser/keyword.rs b/src/test/ui/parser/keyword.rs index 92c05e53b60..1eb7886c5a5 100644 --- a/src/test/ui/parser/keyword.rs +++ b/src/test/ui/parser/keyword.rs @@ -1,5 +1,5 @@ -// compile-flags: -Z parse-only - pub mod break { //~^ ERROR expected identifier, found keyword `break` } + +fn main() {} diff --git a/src/test/ui/parser/keyword.stderr b/src/test/ui/parser/keyword.stderr index 1c729ff0833..262467b6907 100644 --- a/src/test/ui/parser/keyword.stderr +++ b/src/test/ui/parser/keyword.stderr @@ -1,5 +1,5 @@ error: expected identifier, found keyword `break` - --> $DIR/keyword.rs:3:9 + --> $DIR/keyword.rs:1:9 | LL | pub mod break { | ^^^^^ expected identifier, found keyword diff --git a/src/test/ui/parser/keywords-followed-by-double-colon.rs b/src/test/ui/parser/keywords-followed-by-double-colon.rs index cdcfa74e072..5c7049f7c9b 100644 --- a/src/test/ui/parser/keywords-followed-by-double-colon.rs +++ b/src/test/ui/parser/keywords-followed-by-double-colon.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { struct::foo(); //~^ ERROR expected identifier diff --git a/src/test/ui/parser/keywords-followed-by-double-colon.stderr b/src/test/ui/parser/keywords-followed-by-double-colon.stderr index b4b76470de1..4c4d5e5dd00 100644 --- a/src/test/ui/parser/keywords-followed-by-double-colon.stderr +++ b/src/test/ui/parser/keywords-followed-by-double-colon.stderr @@ -1,11 +1,11 @@ error: expected identifier, found `::` - --> $DIR/keywords-followed-by-double-colon.rs:4:11 + --> $DIR/keywords-followed-by-double-colon.rs:2:11 | LL | struct::foo(); | ^^ expected identifier error: expected expression, found keyword `mut` - --> $DIR/keywords-followed-by-double-colon.rs:8:5 + --> $DIR/keywords-followed-by-double-colon.rs:6:5 | LL | mut::baz(); | ^^^ expected expression diff --git a/src/test/ui/parser/lex-bad-binary-literal.rs b/src/test/ui/parser/lex-bad-binary-literal.rs index 316e7398a4a..da36537f0f3 100644 --- a/src/test/ui/parser/lex-bad-binary-literal.rs +++ b/src/test/ui/parser/lex-bad-binary-literal.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error fn main() { 0b121; //~ ERROR invalid digit for a base 2 literal diff --git a/src/test/ui/parser/lex-bad-char-literals-1.rs b/src/test/ui/parser/lex-bad-char-literals-1.rs index 6620c9b6805..54d75ed682d 100644 --- a/src/test/ui/parser/lex-bad-char-literals-1.rs +++ b/src/test/ui/parser/lex-bad-char-literals-1.rs @@ -1,9 +1,9 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error static c3: char = '\x1' //~ ERROR: numeric character escape is too short ; -static s: &'static str = +static s3: &'static str = "\x1" //~ ERROR: numeric character escape is too short ; @@ -15,3 +15,4 @@ static s: &'static str = "\●" //~ ERROR: unknown character escape ; +fn main() {} diff --git a/src/test/ui/parser/lex-bad-char-literals-2.rs b/src/test/ui/parser/lex-bad-char-literals-2.rs index 0579302d5f2..7f859995218 100644 --- a/src/test/ui/parser/lex-bad-char-literals-2.rs +++ b/src/test/ui/parser/lex-bad-char-literals-2.rs @@ -1,7 +1,4 @@ -// compile-flags: -Z parse-only - // This test needs to the last one appearing in this file as it kills the parser static c: char = 'nope' //~ ERROR: character literal may only contain one codepoint: 'nope' ; - diff --git a/src/test/ui/parser/lex-bad-char-literals-2.stderr b/src/test/ui/parser/lex-bad-char-literals-2.stderr index 99c7147f1e4..a7075b71878 100644 --- a/src/test/ui/parser/lex-bad-char-literals-2.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-2.stderr @@ -1,5 +1,5 @@ error: character literal may only contain one codepoint: 'nope' - --> $DIR/lex-bad-char-literals-2.rs:5:5 + --> $DIR/lex-bad-char-literals-2.rs:3:5 | LL | 'nope' //~ ERROR: character literal may only contain one codepoint: 'nope' | ^^^^^^ diff --git a/src/test/ui/parser/lex-bad-char-literals-3.rs b/src/test/ui/parser/lex-bad-char-literals-3.rs index 0ea8290ad93..f8749708f77 100644 --- a/src/test/ui/parser/lex-bad-char-literals-3.rs +++ b/src/test/ui/parser/lex-bad-char-literals-3.rs @@ -1,6 +1,7 @@ -// compile-flags: -Z parse-only - // This test needs to the last one appearing in this file as it kills the parser static c: char = '●●' //~ ERROR: character literal may only contain one codepoint + //~| ERROR: mismatched types ; + +fn main() {} diff --git a/src/test/ui/parser/lex-bad-char-literals-3.stderr b/src/test/ui/parser/lex-bad-char-literals-3.stderr index 7b962528b3c..89f18e3e2aa 100644 --- a/src/test/ui/parser/lex-bad-char-literals-3.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-3.stderr @@ -1,5 +1,5 @@ error: character literal may only contain one codepoint - --> $DIR/lex-bad-char-literals-3.rs:5:5 + --> $DIR/lex-bad-char-literals-3.rs:3:5 | LL | '●●' //~ ERROR: character literal may only contain one codepoint | ^^^^ @@ -8,5 +8,15 @@ help: if you meant to write a `str` literal, use double quotes LL | "●●" //~ ERROR: character literal may only contain one codepoint | ^^^^ -error: aborting due to previous error +error[E0308]: mismatched types + --> $DIR/lex-bad-char-literals-3.rs:3:5 + | +LL | '●●' //~ ERROR: character literal may only contain one codepoint + | ^^^^ expected char, found reference + | + = note: expected type `char` + found type `&'static str` +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/parser/lex-bad-char-literals-4.rs b/src/test/ui/parser/lex-bad-char-literals-4.rs index 8ac2d905ef9..966e2bb9496 100644 --- a/src/test/ui/parser/lex-bad-char-literals-4.rs +++ b/src/test/ui/parser/lex-bad-char-literals-4.rs @@ -1,4 +1,3 @@ -// compile-flags: -Z parse-only // // This test needs to the last one appearing in this file as it kills the parser static c: char = diff --git a/src/test/ui/parser/lex-bad-char-literals-4.stderr b/src/test/ui/parser/lex-bad-char-literals-4.stderr index 7ad4001a455..550cb5449df 100644 --- a/src/test/ui/parser/lex-bad-char-literals-4.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-4.stderr @@ -1,5 +1,5 @@ error: character literal may only contain one codepoint: '● - --> $DIR/lex-bad-char-literals-4.rs:5:5 + --> $DIR/lex-bad-char-literals-4.rs:4:5 | LL | '● //~ ERROR: character literal may only contain one codepoint: '● | ^^ diff --git a/src/test/ui/parser/lex-bad-char-literals-5.rs b/src/test/ui/parser/lex-bad-char-literals-5.rs index 3c7bcf08718..247289ea4d5 100644 --- a/src/test/ui/parser/lex-bad-char-literals-5.rs +++ b/src/test/ui/parser/lex-bad-char-literals-5.rs @@ -1,6 +1,8 @@ -// compile-flags: -Z parse-only // // This test needs to the last one appearing in this file as it kills the parser static c: char = '\x10\x10' //~ ERROR: character literal may only contain one codepoint + //~| ERROR: mismatched types ; + +fn main() {} diff --git a/src/test/ui/parser/lex-bad-char-literals-5.stderr b/src/test/ui/parser/lex-bad-char-literals-5.stderr index 59acc48aaaf..523d71ff49d 100644 --- a/src/test/ui/parser/lex-bad-char-literals-5.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-5.stderr @@ -1,5 +1,5 @@ error: character literal may only contain one codepoint - --> $DIR/lex-bad-char-literals-5.rs:5:5 + --> $DIR/lex-bad-char-literals-5.rs:4:5 | LL | '/x10/x10' //~ ERROR: character literal may only contain one codepoint | ^^^^^^^^^^ @@ -8,5 +8,15 @@ help: if you meant to write a `str` literal, use double quotes LL | "/x10/x10" //~ ERROR: character literal may only contain one codepoint | ^^^^^^^^^^ -error: aborting due to previous error +error[E0308]: mismatched types + --> $DIR/lex-bad-char-literals-5.rs:4:5 + | +LL | '/x10/x10' //~ ERROR: character literal may only contain one codepoint + | ^^^^^^^^^^ expected char, found reference + | + = note: expected type `char` + found type `&'static str` +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/parser/lex-bad-numeric-literals.rs b/src/test/ui/parser/lex-bad-numeric-literals.rs index f478c15b33d..9496ad305fc 100644 --- a/src/test/ui/parser/lex-bad-numeric-literals.rs +++ b/src/test/ui/parser/lex-bad-numeric-literals.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error fn main() { 0o1.0; //~ ERROR: octal float literal is not supported diff --git a/src/test/ui/parser/lex-bad-octal-literal.rs b/src/test/ui/parser/lex-bad-octal-literal.rs index 70f1aa41919..f4cc2c5c420 100644 --- a/src/test/ui/parser/lex-bad-octal-literal.rs +++ b/src/test/ui/parser/lex-bad-octal-literal.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error fn main() { 0o18; //~ ERROR invalid digit for a base 8 literal diff --git a/src/test/ui/parser/lex-bad-token.rs b/src/test/ui/parser/lex-bad-token.rs index 6bcc13815a4..feb670c3d3d 100644 --- a/src/test/ui/parser/lex-bad-token.rs +++ b/src/test/ui/parser/lex-bad-token.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - ● //~ ERROR: unknown start of token diff --git a/src/test/ui/parser/lex-bad-token.stderr b/src/test/ui/parser/lex-bad-token.stderr index 7476bf3736a..284ffde9efb 100644 --- a/src/test/ui/parser/lex-bad-token.stderr +++ b/src/test/ui/parser/lex-bad-token.stderr @@ -1,5 +1,5 @@ error: unknown start of token: /u{25cf} - --> $DIR/lex-bad-token.rs:3:1 + --> $DIR/lex-bad-token.rs:1:1 | LL | ● //~ ERROR: unknown start of token | ^ diff --git a/src/test/ui/parser/lex-bare-cr-string-literal-doc-comment.rs b/src/test/ui/parser/lex-bare-cr-string-literal-doc-comment.rs index 21fbfe715e8..b588b007ae9 100644 --- a/src/test/ui/parser/lex-bare-cr-string-literal-doc-comment.rs +++ b/src/test/ui/parser/lex-bare-cr-string-literal-doc-comment.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error // ignore-tidy-cr diff --git a/src/test/ui/parser/lex-stray-backslash.rs b/src/test/ui/parser/lex-stray-backslash.rs index d6cccfa6c71..90d359231a6 100644 --- a/src/test/ui/parser/lex-stray-backslash.rs +++ b/src/test/ui/parser/lex-stray-backslash.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - \ //~ ERROR: unknown start of token: \ diff --git a/src/test/ui/parser/lex-stray-backslash.stderr b/src/test/ui/parser/lex-stray-backslash.stderr index 0fd05d78f98..40e0cc1d786 100644 --- a/src/test/ui/parser/lex-stray-backslash.stderr +++ b/src/test/ui/parser/lex-stray-backslash.stderr @@ -1,5 +1,5 @@ error: unknown start of token: / - --> $DIR/lex-stray-backslash.rs:3:1 + --> $DIR/lex-stray-backslash.rs:1:1 | LL | / //~ ERROR: unknown start of token: / | ^ diff --git a/src/test/ui/parser/lifetime-in-pattern.rs b/src/test/ui/parser/lifetime-in-pattern.rs index 1535cfe2996..afee685cd05 100644 --- a/src/test/ui/parser/lifetime-in-pattern.rs +++ b/src/test/ui/parser/lifetime-in-pattern.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn test(&'a str) { //~^ ERROR unexpected lifetime `'a` in pattern } diff --git a/src/test/ui/parser/lifetime-in-pattern.stderr b/src/test/ui/parser/lifetime-in-pattern.stderr index 782b6c1d2fd..e525c7b6d68 100644 --- a/src/test/ui/parser/lifetime-in-pattern.stderr +++ b/src/test/ui/parser/lifetime-in-pattern.stderr @@ -1,5 +1,5 @@ error: unexpected lifetime `'a` in pattern - --> $DIR/lifetime-in-pattern.rs:3:10 + --> $DIR/lifetime-in-pattern.rs:1:10 | LL | fn test(&'a str) { | ^^ unexpected lifetime diff --git a/src/test/ui/parser/lifetime-semicolon.rs b/src/test/ui/parser/lifetime-semicolon.rs index ede3eaeb37b..1f147216ea6 100644 --- a/src/test/ui/parser/lifetime-semicolon.rs +++ b/src/test/ui/parser/lifetime-semicolon.rs @@ -1,8 +1,8 @@ -// compile-flags: -Z parse-only - struct Foo<'a, 'b> { a: &'a &'b i32 } fn foo<'a, 'b>(x: &mut Foo<'a; 'b>) {} //~^ ERROR expected one of `,` or `>`, found `;` + +fn main() {} diff --git a/src/test/ui/parser/lifetime-semicolon.stderr b/src/test/ui/parser/lifetime-semicolon.stderr index acc5e92ff14..71ed8200e9a 100644 --- a/src/test/ui/parser/lifetime-semicolon.stderr +++ b/src/test/ui/parser/lifetime-semicolon.stderr @@ -1,5 +1,5 @@ error: expected one of `,` or `>`, found `;` - --> $DIR/lifetime-semicolon.rs:7:30 + --> $DIR/lifetime-semicolon.rs:5:30 | LL | fn foo<'a, 'b>(x: &mut Foo<'a; 'b>) {} | ^ expected one of `,` or `>` here diff --git a/src/test/ui/parser/macro-bad-delimiter-ident.rs b/src/test/ui/parser/macro-bad-delimiter-ident.rs index 56eb976b9c6..987c955d1dc 100644 --- a/src/test/ui/parser/macro-bad-delimiter-ident.rs +++ b/src/test/ui/parser/macro-bad-delimiter-ident.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { foo! bar < //~ ERROR expected `(` or `{`, found `<` } diff --git a/src/test/ui/parser/macro-bad-delimiter-ident.stderr b/src/test/ui/parser/macro-bad-delimiter-ident.stderr index c6d1382f7f3..59762e02165 100644 --- a/src/test/ui/parser/macro-bad-delimiter-ident.stderr +++ b/src/test/ui/parser/macro-bad-delimiter-ident.stderr @@ -1,5 +1,5 @@ error: expected `(` or `{`, found `<` - --> $DIR/macro-bad-delimiter-ident.rs:4:14 + --> $DIR/macro-bad-delimiter-ident.rs:2:14 | LL | foo! bar < //~ ERROR expected `(` or `{`, found `<` | ^ expected `(` or `{` diff --git a/src/test/ui/parser/macro-keyword.rs b/src/test/ui/parser/macro-keyword.rs index cb1898e6ea7..58489fb2c51 100644 --- a/src/test/ui/parser/macro-keyword.rs +++ b/src/test/ui/parser/macro-keyword.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn macro() { //~ ERROR expected identifier, found reserved keyword `macro` } diff --git a/src/test/ui/parser/macro-keyword.stderr b/src/test/ui/parser/macro-keyword.stderr index d3edb04c119..4a10dd50b23 100644 --- a/src/test/ui/parser/macro-keyword.stderr +++ b/src/test/ui/parser/macro-keyword.stderr @@ -1,5 +1,5 @@ error: expected identifier, found reserved keyword `macro` - --> $DIR/macro-keyword.rs:3:4 + --> $DIR/macro-keyword.rs:1:4 | LL | fn macro() { //~ ERROR expected identifier, found reserved keyword `macro` | ^^^^^ expected identifier, found reserved keyword diff --git a/src/test/ui/parser/macro-mismatched-delim-brace-paren.rs b/src/test/ui/parser/macro-mismatched-delim-brace-paren.rs index 29fdd9efdf2..3f3e997dece 100644 --- a/src/test/ui/parser/macro-mismatched-delim-brace-paren.rs +++ b/src/test/ui/parser/macro-mismatched-delim-brace-paren.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only +macro_rules! foo { ($($tt:tt)*) => () } fn main() { foo! { diff --git a/src/test/ui/parser/macro-mismatched-delim-paren-brace.rs b/src/test/ui/parser/macro-mismatched-delim-paren-brace.rs index 38e5393b04a..1185f882a13 100644 --- a/src/test/ui/parser/macro-mismatched-delim-paren-brace.rs +++ b/src/test/ui/parser/macro-mismatched-delim-paren-brace.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { foo! ( bar, "baz", 1, 2.0 diff --git a/src/test/ui/parser/macro-mismatched-delim-paren-brace.stderr b/src/test/ui/parser/macro-mismatched-delim-paren-brace.stderr index c25e5fef1a7..805ba8b6baa 100644 --- a/src/test/ui/parser/macro-mismatched-delim-paren-brace.stderr +++ b/src/test/ui/parser/macro-mismatched-delim-paren-brace.stderr @@ -1,5 +1,5 @@ error: incorrect close delimiter: `}` - --> $DIR/macro-mismatched-delim-paren-brace.rs:6:5 + --> $DIR/macro-mismatched-delim-paren-brace.rs:4:5 | LL | foo! ( | - un-closed delimiter @@ -8,7 +8,7 @@ LL | } //~ ERROR incorrect close delimiter | ^ incorrect close delimiter error: unexpected close delimiter: `}` - --> $DIR/macro-mismatched-delim-paren-brace.rs:7:1 + --> $DIR/macro-mismatched-delim-paren-brace.rs:5:1 | LL | } //~ ERROR unexpected close delimiter: `}` | ^ unexpected close delimiter diff --git a/src/test/ui/parser/macros-no-semicolon-items.rs b/src/test/ui/parser/macros-no-semicolon-items.rs index 2c3284b6d2d..a727cafcab0 100644 --- a/src/test/ui/parser/macros-no-semicolon-items.rs +++ b/src/test/ui/parser/macros-no-semicolon-items.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - macro_rules! foo() //~ ERROR semicolon fn main() { diff --git a/src/test/ui/parser/macros-no-semicolon-items.stderr b/src/test/ui/parser/macros-no-semicolon-items.stderr index efdca38cdea..84dd302b4a8 100644 --- a/src/test/ui/parser/macros-no-semicolon-items.stderr +++ b/src/test/ui/parser/macros-no-semicolon-items.stderr @@ -1,5 +1,5 @@ error: macros that expand to items must either be surrounded with braces or followed by a semicolon - --> $DIR/macros-no-semicolon-items.rs:3:17 + --> $DIR/macros-no-semicolon-items.rs:1:17 | LL | macro_rules! foo() //~ ERROR semicolon | ^^ diff --git a/src/test/ui/parser/macros-no-semicolon.rs b/src/test/ui/parser/macros-no-semicolon.rs index 0ad5b8d3f81..fd79fa8df7a 100644 --- a/src/test/ui/parser/macros-no-semicolon.rs +++ b/src/test/ui/parser/macros-no-semicolon.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { assert_eq!(1, 2) assert_eq!(3, 4) //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `assert_eq` diff --git a/src/test/ui/parser/macros-no-semicolon.stderr b/src/test/ui/parser/macros-no-semicolon.stderr index 01ca2a6ff07..4f9e7fb5de8 100644 --- a/src/test/ui/parser/macros-no-semicolon.stderr +++ b/src/test/ui/parser/macros-no-semicolon.stderr @@ -1,5 +1,5 @@ error: expected one of `.`, `;`, `?`, `}`, or an operator, found `assert_eq` - --> $DIR/macros-no-semicolon.rs:5:5 + --> $DIR/macros-no-semicolon.rs:3:5 | LL | assert_eq!(1, 2) | - expected one of `.`, `;`, `?`, `}`, or an operator here diff --git a/src/test/ui/parser/match-arrows-block-then-binop.rs b/src/test/ui/parser/match-arrows-block-then-binop.rs index 1a79da38c3d..1a40d674929 100644 --- a/src/test/ui/parser/match-arrows-block-then-binop.rs +++ b/src/test/ui/parser/match-arrows-block-then-binop.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { match 0 { diff --git a/src/test/ui/parser/match-arrows-block-then-binop.stderr b/src/test/ui/parser/match-arrows-block-then-binop.stderr index 4ba87efbed7..2782af49e66 100644 --- a/src/test/ui/parser/match-arrows-block-then-binop.stderr +++ b/src/test/ui/parser/match-arrows-block-then-binop.stderr @@ -1,5 +1,5 @@ error: expected pattern, found `+` - --> $DIR/match-arrows-block-then-binop.rs:7:9 + --> $DIR/match-arrows-block-then-binop.rs:5:9 | LL | } + 5 //~ ERROR expected pattern, found `+` | ^ expected pattern diff --git a/src/test/ui/parser/match-refactor-to-expr.rs b/src/test/ui/parser/match-refactor-to-expr.rs index ac7fe5fc1ca..09ebb2e1d83 100644 --- a/src/test/ui/parser/match-refactor-to-expr.rs +++ b/src/test/ui/parser/match-refactor-to-expr.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let foo = match //~ NOTE while parsing this match expression diff --git a/src/test/ui/parser/match-refactor-to-expr.stderr b/src/test/ui/parser/match-refactor-to-expr.stderr index f6fcefe83e5..692b116123a 100644 --- a/src/test/ui/parser/match-refactor-to-expr.stderr +++ b/src/test/ui/parser/match-refactor-to-expr.stderr @@ -1,5 +1,5 @@ error: expected one of `.`, `?`, `{`, or an operator, found `;` - --> $DIR/match-refactor-to-expr.rs:8:9 + --> $DIR/match-refactor-to-expr.rs:6:9 | LL | match //~ NOTE while parsing this match expression | ----- diff --git a/src/test/ui/parser/match-vec-invalid.rs b/src/test/ui/parser/match-vec-invalid.rs index 9c8fb1eff49..e5e85ba8ca6 100644 --- a/src/test/ui/parser/match-vec-invalid.rs +++ b/src/test/ui/parser/match-vec-invalid.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let a = Vec::new(); match a { diff --git a/src/test/ui/parser/match-vec-invalid.stderr b/src/test/ui/parser/match-vec-invalid.stderr index 7168f0b8d55..5a5fc9c4509 100644 --- a/src/test/ui/parser/match-vec-invalid.stderr +++ b/src/test/ui/parser/match-vec-invalid.stderr @@ -1,5 +1,5 @@ error: expected one of `,` or `@`, found `..` - --> $DIR/match-vec-invalid.rs:6:25 + --> $DIR/match-vec-invalid.rs:4:25 | LL | [1, tail.., tail..] => {}, //~ ERROR: expected one of `,` or `@`, found `..` | ^^ expected one of `,` or `@` here diff --git a/src/test/ui/parser/mod_file_not_exist.rs b/src/test/ui/parser/mod_file_not_exist.rs index a6c1028ce13..e662c707a38 100644 --- a/src/test/ui/parser/mod_file_not_exist.rs +++ b/src/test/ui/parser/mod_file_not_exist.rs @@ -1,5 +1,4 @@ // ignore-windows -// compile-flags: -Z parse-only mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` //~^ HELP name the file either not_a_real_file.rs or not_a_real_file/mod.rs inside the directory diff --git a/src/test/ui/parser/mod_file_not_exist.stderr b/src/test/ui/parser/mod_file_not_exist.stderr index 3e06a5ddd27..f7f0e2d2d11 100644 --- a/src/test/ui/parser/mod_file_not_exist.stderr +++ b/src/test/ui/parser/mod_file_not_exist.stderr @@ -1,5 +1,5 @@ error[E0583]: file not found for module `not_a_real_file` - --> $DIR/mod_file_not_exist.rs:4:5 + --> $DIR/mod_file_not_exist.rs:3:5 | LL | mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` | ^^^^^^^^^^^^^^^ diff --git a/src/test/ui/parser/mod_file_not_exist_windows.rs b/src/test/ui/parser/mod_file_not_exist_windows.rs index c7ffe7bd0fd..0cd9e9c799f 100644 --- a/src/test/ui/parser/mod_file_not_exist_windows.rs +++ b/src/test/ui/parser/mod_file_not_exist_windows.rs @@ -1,5 +1,4 @@ // only-windows -// compile-flags: -Z parse-only mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` //~^ HELP name the file either not_a_real_file.rs or not_a_real_file\mod.rs inside the directory diff --git a/src/test/ui/parser/mod_file_not_exist_windows.stderr b/src/test/ui/parser/mod_file_not_exist_windows.stderr index 0f8b9c06e7f..67abd6304d5 100644 --- a/src/test/ui/parser/mod_file_not_exist_windows.stderr +++ b/src/test/ui/parser/mod_file_not_exist_windows.stderr @@ -1,5 +1,5 @@ error[E0583]: file not found for module `not_a_real_file` - --> $DIR/mod_file_not_exist_windows.rs:4:5 + --> $DIR/mod_file_not_exist_windows.rs:3:5 | LL | mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` | ^^^^^^^^^^^^^^^ diff --git a/src/test/ui/parser/mod_file_with_path_attr.rs b/src/test/ui/parser/mod_file_with_path_attr.rs index 6f355ae028b..9450d89e5f5 100644 --- a/src/test/ui/parser/mod_file_with_path_attr.rs +++ b/src/test/ui/parser/mod_file_with_path_attr.rs @@ -1,4 +1,3 @@ -// compile-flags: -Z parse-only // normalize-stderr-test: "not_a_real_file.rs:.*\(" -> "not_a_real_file.rs: $$FILE_NOT_FOUND_MSG (" #[path = "not_a_real_file.rs"] diff --git a/src/test/ui/parser/mod_file_with_path_attr.stderr b/src/test/ui/parser/mod_file_with_path_attr.stderr index 22bd81196d5..a3a3486dd9e 100644 --- a/src/test/ui/parser/mod_file_with_path_attr.stderr +++ b/src/test/ui/parser/mod_file_with_path_attr.stderr @@ -1,5 +1,5 @@ error: couldn't read $DIR/not_a_real_file.rs: $FILE_NOT_FOUND_MSG (os error 2) - --> $DIR/mod_file_with_path_attr.rs:5:5 + --> $DIR/mod_file_with_path_attr.rs:4:5 | LL | mod m; //~ ERROR not_a_real_file.rs | ^ diff --git a/src/test/ui/parser/multiline-comment-line-tracking.rs b/src/test/ui/parser/multiline-comment-line-tracking.rs index e528819b39b..d4735e8a738 100644 --- a/src/test/ui/parser/multiline-comment-line-tracking.rs +++ b/src/test/ui/parser/multiline-comment-line-tracking.rs @@ -1,10 +1,9 @@ -// compile-flags: -Z parse-only -// error-pattern:9:3 +// Parse error on line X, but is reported on line Y instead. /* 1 * 2 * 3 */ fn main() { - %; // parse error on line 19, but is reported on line 6 instead. + %; //~ ERROR expected expression, found `%` } diff --git a/src/test/ui/parser/multiline-comment-line-tracking.stderr b/src/test/ui/parser/multiline-comment-line-tracking.stderr index 500b3423ff1..c9404d8b9e4 100644 --- a/src/test/ui/parser/multiline-comment-line-tracking.stderr +++ b/src/test/ui/parser/multiline-comment-line-tracking.stderr @@ -1,7 +1,7 @@ error: expected expression, found `%` - --> $DIR/multiline-comment-line-tracking.rs:9:3 + --> $DIR/multiline-comment-line-tracking.rs:8:3 | -LL | %; // parse error on line 19, but is reported on line 6 instead. +LL | %; //~ ERROR expected expression, found `%` | ^ expected expression error: aborting due to previous error diff --git a/src/test/ui/parser/multitrait.rs b/src/test/ui/parser/multitrait.rs index 2c6275699b4..f9b4b37acc0 100644 --- a/src/test/ui/parser/multitrait.rs +++ b/src/test/ui/parser/multitrait.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - struct S { y: isize } diff --git a/src/test/ui/parser/multitrait.stderr b/src/test/ui/parser/multitrait.stderr index c9400c0153d..61dbc823848 100644 --- a/src/test/ui/parser/multitrait.stderr +++ b/src/test/ui/parser/multitrait.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `,` - --> $DIR/multitrait.rs:7:9 + --> $DIR/multitrait.rs:5:9 | LL | impl Cmp, ToString for S { | ^ expected one of 8 possible tokens here diff --git a/src/test/ui/parser/mut-patterns.rs b/src/test/ui/parser/mut-patterns.rs index 9c4384c5385..a5eb4825239 100644 --- a/src/test/ui/parser/mut-patterns.rs +++ b/src/test/ui/parser/mut-patterns.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Can't put mut in non-ident pattern pub fn main() { diff --git a/src/test/ui/parser/mut-patterns.stderr b/src/test/ui/parser/mut-patterns.stderr index 09a21d894b9..5bbb4ce569f 100644 --- a/src/test/ui/parser/mut-patterns.stderr +++ b/src/test/ui/parser/mut-patterns.stderr @@ -1,5 +1,5 @@ error: expected one of `:`, `;`, `=`, or `@`, found `{` - --> $DIR/mut-patterns.rs:7:17 + --> $DIR/mut-patterns.rs:5:17 | LL | let mut Foo { x: x } = Foo { x: 3 }; //~ ERROR: expected one of `:`, `;`, `=`, or `@`, found `{` | ^ expected one of `:`, `;`, `=`, or `@` here diff --git a/src/test/ui/parser/new-unicode-escapes-1.rs b/src/test/ui/parser/new-unicode-escapes-1.rs index cf75cdaa98a..0e1421214d9 100644 --- a/src/test/ui/parser/new-unicode-escapes-1.rs +++ b/src/test/ui/parser/new-unicode-escapes-1.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - pub fn main() { let s = "\u{2603"; //~ ERROR unterminated unicode escape (needed a `}`) } diff --git a/src/test/ui/parser/new-unicode-escapes-1.stderr b/src/test/ui/parser/new-unicode-escapes-1.stderr index 77a7980e893..828e72e56ea 100644 --- a/src/test/ui/parser/new-unicode-escapes-1.stderr +++ b/src/test/ui/parser/new-unicode-escapes-1.stderr @@ -1,5 +1,5 @@ error: unterminated unicode escape (needed a `}`) - --> $DIR/new-unicode-escapes-1.rs:4:21 + --> $DIR/new-unicode-escapes-1.rs:2:21 | LL | let s = "/u{2603"; //~ ERROR unterminated unicode escape (needed a `}`) | ^ diff --git a/src/test/ui/parser/new-unicode-escapes-2.rs b/src/test/ui/parser/new-unicode-escapes-2.rs index 228518f8c1a..b30b3dbf903 100644 --- a/src/test/ui/parser/new-unicode-escapes-2.rs +++ b/src/test/ui/parser/new-unicode-escapes-2.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - pub fn main() { let s = "\u{260311111111}"; //~ ERROR overlong unicode escape (must have at most 6 hex digits) } diff --git a/src/test/ui/parser/new-unicode-escapes-2.stderr b/src/test/ui/parser/new-unicode-escapes-2.stderr index 4f5bef1802f..97ba3fb2cb6 100644 --- a/src/test/ui/parser/new-unicode-escapes-2.stderr +++ b/src/test/ui/parser/new-unicode-escapes-2.stderr @@ -1,5 +1,5 @@ error: overlong unicode escape (must have at most 6 hex digits) - --> $DIR/new-unicode-escapes-2.rs:4:17 + --> $DIR/new-unicode-escapes-2.rs:2:17 | LL | let s = "/u{260311111111}"; //~ ERROR overlong unicode escape (must have at most 6 hex digits) | ^^^^^^^^^^^^ diff --git a/src/test/ui/parser/new-unicode-escapes-3.rs b/src/test/ui/parser/new-unicode-escapes-3.rs index 8a38e1407ac..295ab08c002 100644 --- a/src/test/ui/parser/new-unicode-escapes-3.rs +++ b/src/test/ui/parser/new-unicode-escapes-3.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - pub fn main() { let s1 = "\u{d805}"; //~ ERROR invalid unicode character escape let s2 = "\u{ffffff}"; //~ ERROR invalid unicode character escape diff --git a/src/test/ui/parser/new-unicode-escapes-3.stderr b/src/test/ui/parser/new-unicode-escapes-3.stderr index 158b3a19f01..038002ae05e 100644 --- a/src/test/ui/parser/new-unicode-escapes-3.stderr +++ b/src/test/ui/parser/new-unicode-escapes-3.stderr @@ -1,5 +1,5 @@ error: invalid unicode character escape - --> $DIR/new-unicode-escapes-3.rs:4:14 + --> $DIR/new-unicode-escapes-3.rs:2:14 | LL | let s1 = "/u{d805}"; //~ ERROR invalid unicode character escape | ^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | let s1 = "/u{d805}"; //~ ERROR invalid unicode character escape = help: unicode escape must not be a surrogate error: invalid unicode character escape - --> $DIR/new-unicode-escapes-3.rs:5:14 + --> $DIR/new-unicode-escapes-3.rs:3:14 | LL | let s2 = "/u{ffffff}"; //~ ERROR invalid unicode character escape | ^^^^^^^^^^^^ diff --git a/src/test/ui/parser/new-unicode-escapes-4.rs b/src/test/ui/parser/new-unicode-escapes-4.rs index 49a35663a91..b871000ac12 100644 --- a/src/test/ui/parser/new-unicode-escapes-4.rs +++ b/src/test/ui/parser/new-unicode-escapes-4.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error pub fn main() { let s = "\u{lol}"; diff --git a/src/test/ui/parser/no-binary-float-literal.rs b/src/test/ui/parser/no-binary-float-literal.rs index c3ed2ac2dcf..c078bf5f63e 100644 --- a/src/test/ui/parser/no-binary-float-literal.rs +++ b/src/test/ui/parser/no-binary-float-literal.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern:binary float literal is not supported fn main() { diff --git a/src/test/ui/parser/no-binary-float-literal.stderr b/src/test/ui/parser/no-binary-float-literal.stderr index c3eab544d7a..7ff3e28ccb6 100644 --- a/src/test/ui/parser/no-binary-float-literal.stderr +++ b/src/test/ui/parser/no-binary-float-literal.stderr @@ -1,5 +1,5 @@ error: binary float literal is not supported - --> $DIR/no-binary-float-literal.rs:7:5 + --> $DIR/no-binary-float-literal.rs:5:5 | LL | 0b101.010; | ^^^^^^^^^ diff --git a/src/test/ui/parser/no-hex-float-literal.rs b/src/test/ui/parser/no-hex-float-literal.rs index 4e56cc2d323..d830c96fc2f 100644 --- a/src/test/ui/parser/no-hex-float-literal.rs +++ b/src/test/ui/parser/no-hex-float-literal.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern:hexadecimal float literal is not supported fn main() { diff --git a/src/test/ui/parser/no-hex-float-literal.stderr b/src/test/ui/parser/no-hex-float-literal.stderr index 7d9aa057ba0..1668cfe5a33 100644 --- a/src/test/ui/parser/no-hex-float-literal.stderr +++ b/src/test/ui/parser/no-hex-float-literal.stderr @@ -1,5 +1,5 @@ error: hexadecimal float literal is not supported - --> $DIR/no-hex-float-literal.rs:7:5 + --> $DIR/no-hex-float-literal.rs:5:5 | LL | 0x567.89; | ^^^^^^^^ diff --git a/src/test/ui/parser/no-unsafe-self.rs b/src/test/ui/parser/no-unsafe-self.rs index c74fc8c25dc..57201f2d91a 100644 --- a/src/test/ui/parser/no-unsafe-self.rs +++ b/src/test/ui/parser/no-unsafe-self.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error trait A { fn foo(*mut self); //~ ERROR cannot pass `self` by raw pointer diff --git a/src/test/ui/parser/not-a-pred.rs b/src/test/ui/parser/not-a-pred.rs index 8efd28b5977..e6a02d5fc56 100644 --- a/src/test/ui/parser/not-a-pred.rs +++ b/src/test/ui/parser/not-a-pred.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // error-pattern: lt fn f(a: isize, b: isize) : lt(a, b) { } diff --git a/src/test/ui/parser/not-a-pred.stderr b/src/test/ui/parser/not-a-pred.stderr index db6e0697914..46d6038e802 100644 --- a/src/test/ui/parser/not-a-pred.stderr +++ b/src/test/ui/parser/not-a-pred.stderr @@ -1,5 +1,5 @@ error: expected one of `->`, `where`, or `{`, found `:` - --> $DIR/not-a-pred.rs:5:26 + --> $DIR/not-a-pred.rs:3:26 | LL | fn f(a: isize, b: isize) : lt(a, b) { } | ^ expected one of `->`, `where`, or `{` here diff --git a/src/test/ui/parser/omitted-arg-in-item-fn.rs b/src/test/ui/parser/omitted-arg-in-item-fn.rs index a9c0e9133b7..5ee9daf4640 100644 --- a/src/test/ui/parser/omitted-arg-in-item-fn.rs +++ b/src/test/ui/parser/omitted-arg-in-item-fn.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only - fn foo(x) { //~ ERROR expected one of `:` or `@`, found `)` } + +fn main() {} diff --git a/src/test/ui/parser/omitted-arg-in-item-fn.stderr b/src/test/ui/parser/omitted-arg-in-item-fn.stderr index 0e3717f861a..b21a1bd0831 100644 --- a/src/test/ui/parser/omitted-arg-in-item-fn.stderr +++ b/src/test/ui/parser/omitted-arg-in-item-fn.stderr @@ -1,5 +1,5 @@ error: expected one of `:` or `@`, found `)` - --> $DIR/omitted-arg-in-item-fn.rs:3:9 + --> $DIR/omitted-arg-in-item-fn.rs:1:9 | LL | fn foo(x) { //~ ERROR expected one of `:` or `@`, found `)` | ^ expected one of `:` or `@` here diff --git a/src/test/ui/parser/paamayim-nekudotayim.rs b/src/test/ui/parser/paamayim-nekudotayim.rs index 9ae57223c86..cb151d652e1 100644 --- a/src/test/ui/parser/paamayim-nekudotayim.rs +++ b/src/test/ui/parser/paamayim-nekudotayim.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // http://phpsadness.com/sad/1 fn main() { diff --git a/src/test/ui/parser/paamayim-nekudotayim.stderr b/src/test/ui/parser/paamayim-nekudotayim.stderr index dfab02ea5e0..6423aa2dc2f 100644 --- a/src/test/ui/parser/paamayim-nekudotayim.stderr +++ b/src/test/ui/parser/paamayim-nekudotayim.stderr @@ -1,5 +1,5 @@ error: expected identifier, found `;` - --> $DIR/paamayim-nekudotayim.rs:6:7 + --> $DIR/paamayim-nekudotayim.rs:4:7 | LL | ::; //~ ERROR expected identifier, found `;` | ^ expected identifier diff --git a/src/test/ui/parser/paren-after-qualified-path-in-match.rs b/src/test/ui/parser/paren-after-qualified-path-in-match.rs index dec0ba820b9..68b1c2baf10 100644 --- a/src/test/ui/parser/paren-after-qualified-path-in-match.rs +++ b/src/test/ui/parser/paren-after-qualified-path-in-match.rs @@ -1,7 +1,5 @@ -// compile-flags: -Z parse-only - -fn foo() { - match x { +fn main() { + match 10 { ::Type(2) => (), //~^ ERROR unexpected `(` after qualified path _ => (), diff --git a/src/test/ui/parser/paren-after-qualified-path-in-match.stderr b/src/test/ui/parser/paren-after-qualified-path-in-match.stderr index bee68651782..79460e01f25 100644 --- a/src/test/ui/parser/paren-after-qualified-path-in-match.stderr +++ b/src/test/ui/parser/paren-after-qualified-path-in-match.stderr @@ -1,5 +1,5 @@ error: unexpected `(` after qualified path - --> $DIR/paren-after-qualified-path-in-match.rs:5:27 + --> $DIR/paren-after-qualified-path-in-match.rs:3:27 | LL | ::Type(2) => (), | ^ unexpected `(` after qualified path diff --git a/src/test/ui/parser/pat-lt-bracket-1.rs b/src/test/ui/parser/pat-lt-bracket-1.rs index 5ef43ab0178..2e2001434f2 100644 --- a/src/test/ui/parser/pat-lt-bracket-1.rs +++ b/src/test/ui/parser/pat-lt-bracket-1.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { match 42 { x < 7 => (), diff --git a/src/test/ui/parser/pat-lt-bracket-1.stderr b/src/test/ui/parser/pat-lt-bracket-1.stderr index a420931a703..1bf27161513 100644 --- a/src/test/ui/parser/pat-lt-bracket-1.stderr +++ b/src/test/ui/parser/pat-lt-bracket-1.stderr @@ -1,5 +1,5 @@ error: expected one of `=>`, `@`, `if`, or `|`, found `<` - --> $DIR/pat-lt-bracket-1.rs:5:7 + --> $DIR/pat-lt-bracket-1.rs:3:7 | LL | x < 7 => (), | ^ expected one of `=>`, `@`, `if`, or `|` here diff --git a/src/test/ui/parser/pat-lt-bracket-2.rs b/src/test/ui/parser/pat-lt-bracket-2.rs index 3459c739109..6eb01c1c933 100644 --- a/src/test/ui/parser/pat-lt-bracket-2.rs +++ b/src/test/ui/parser/pat-lt-bracket-2.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only - fn a(B<) {} //~^ error: expected one of `:` or `@`, found `<` + +fn main() {} diff --git a/src/test/ui/parser/pat-lt-bracket-2.stderr b/src/test/ui/parser/pat-lt-bracket-2.stderr index d235767dcb4..cce1a17e9e8 100644 --- a/src/test/ui/parser/pat-lt-bracket-2.stderr +++ b/src/test/ui/parser/pat-lt-bracket-2.stderr @@ -1,5 +1,5 @@ error: expected one of `:` or `@`, found `<` - --> $DIR/pat-lt-bracket-2.rs:3:7 + --> $DIR/pat-lt-bracket-2.rs:1:7 | LL | fn a(B<) {} | ^ expected one of `:` or `@` here diff --git a/src/test/ui/parser/pat-lt-bracket-3.rs b/src/test/ui/parser/pat-lt-bracket-3.rs index 349ea9bec49..a8bdfd3fa18 100644 --- a/src/test/ui/parser/pat-lt-bracket-3.rs +++ b/src/test/ui/parser/pat-lt-bracket-3.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - struct Foo(T, T); impl Foo { @@ -12,3 +10,5 @@ impl Foo { } } } + +fn main() {} diff --git a/src/test/ui/parser/pat-lt-bracket-3.stderr b/src/test/ui/parser/pat-lt-bracket-3.stderr index 9c0448f559a..536d14e1b65 100644 --- a/src/test/ui/parser/pat-lt-bracket-3.stderr +++ b/src/test/ui/parser/pat-lt-bracket-3.stderr @@ -1,5 +1,5 @@ error: expected one of `=>`, `@`, `if`, or `|`, found `<` - --> $DIR/pat-lt-bracket-3.rs:8:16 + --> $DIR/pat-lt-bracket-3.rs:6:16 | LL | Foo(x, y) => { | ^ expected one of `=>`, `@`, `if`, or `|` here diff --git a/src/test/ui/parser/pat-lt-bracket-4.rs b/src/test/ui/parser/pat-lt-bracket-4.rs index 96084229998..de314f6c641 100644 --- a/src/test/ui/parser/pat-lt-bracket-4.rs +++ b/src/test/ui/parser/pat-lt-bracket-4.rs @@ -1,12 +1,10 @@ -// compile-flags: -Z parse-only - enum BtNode { Node(u32,Box,Box), Leaf(u32), } fn main() { - let y = match x { + let y = match 10 { Foo::A(value) => value, //~ error: expected one of `=>`, `@`, `if`, or `|`, found `<` Foo::B => 7, }; diff --git a/src/test/ui/parser/pat-lt-bracket-4.stderr b/src/test/ui/parser/pat-lt-bracket-4.stderr index 85f5bb9bc3c..18e0e9e8f0c 100644 --- a/src/test/ui/parser/pat-lt-bracket-4.stderr +++ b/src/test/ui/parser/pat-lt-bracket-4.stderr @@ -1,5 +1,5 @@ error: expected one of `=>`, `@`, `if`, or `|`, found `<` - --> $DIR/pat-lt-bracket-4.rs:10:12 + --> $DIR/pat-lt-bracket-4.rs:8:12 | LL | Foo::A(value) => value, //~ error: expected one of `=>`, `@`, `if`, or `|`, found `<` | ^ expected one of `=>`, `@`, `if`, or `|` here diff --git a/src/test/ui/parser/pat-lt-bracket-5.rs b/src/test/ui/parser/pat-lt-bracket-5.rs index f5253ad405e..c4b9dd469f5 100644 --- a/src/test/ui/parser/pat-lt-bracket-5.rs +++ b/src/test/ui/parser/pat-lt-bracket-5.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[` } diff --git a/src/test/ui/parser/pat-lt-bracket-5.stderr b/src/test/ui/parser/pat-lt-bracket-5.stderr index 3dcace5e06a..7e76a04ce6f 100644 --- a/src/test/ui/parser/pat-lt-bracket-5.stderr +++ b/src/test/ui/parser/pat-lt-bracket-5.stderr @@ -1,5 +1,5 @@ error: expected one of `:`, `;`, `=`, or `@`, found `[` - --> $DIR/pat-lt-bracket-5.rs:4:10 + --> $DIR/pat-lt-bracket-5.rs:2:10 | LL | let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[` | ^ expected one of `:`, `;`, `=`, or `@` here diff --git a/src/test/ui/parser/pat-lt-bracket-6.rs b/src/test/ui/parser/pat-lt-bracket-6.rs index d4639b390c1..9bad0cb25c1 100644 --- a/src/test/ui/parser/pat-lt-bracket-6.rs +++ b/src/test/ui/parser/pat-lt-bracket-6.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[` } diff --git a/src/test/ui/parser/pat-lt-bracket-6.stderr b/src/test/ui/parser/pat-lt-bracket-6.stderr index ea17dc47cc8..bf5b6190761 100644 --- a/src/test/ui/parser/pat-lt-bracket-6.stderr +++ b/src/test/ui/parser/pat-lt-bracket-6.stderr @@ -1,5 +1,5 @@ error: expected one of `)`, `,`, or `@`, found `[` - --> $DIR/pat-lt-bracket-6.rs:4:19 + --> $DIR/pat-lt-bracket-6.rs:2:19 | LL | let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[` | ^ expected one of `)`, `,`, or `@` here diff --git a/src/test/ui/parser/pat-lt-bracket-7.rs b/src/test/ui/parser/pat-lt-bracket-7.rs index 69b97e7cc5b..36c0d773373 100644 --- a/src/test/ui/parser/pat-lt-bracket-7.rs +++ b/src/test/ui/parser/pat-lt-bracket-7.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { for thing(x[]) in foo {} //~ ERROR: expected one of `)`, `,`, or `@`, found `[` } diff --git a/src/test/ui/parser/pat-lt-bracket-7.stderr b/src/test/ui/parser/pat-lt-bracket-7.stderr index c04a7a23f90..44394c30021 100644 --- a/src/test/ui/parser/pat-lt-bracket-7.stderr +++ b/src/test/ui/parser/pat-lt-bracket-7.stderr @@ -1,5 +1,5 @@ error: expected one of `)`, `,`, or `@`, found `[` - --> $DIR/pat-lt-bracket-7.rs:4:16 + --> $DIR/pat-lt-bracket-7.rs:2:16 | LL | for thing(x[]) in foo {} //~ ERROR: expected one of `)`, `,`, or `@`, found `[` | ^ expected one of `)`, `,`, or `@` here diff --git a/src/test/ui/parser/pat-ranges-1.rs b/src/test/ui/parser/pat-ranges-1.rs index 1c8b04bc1fe..ce953b2eb22 100644 --- a/src/test/ui/parser/pat-ranges-1.rs +++ b/src/test/ui/parser/pat-ranges-1.rs @@ -1,7 +1,5 @@ // Parsing of range patterns -// compile-flags: -Z parse-only - fn main() { let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=` } diff --git a/src/test/ui/parser/pat-ranges-1.stderr b/src/test/ui/parser/pat-ranges-1.stderr index 1106cafd9d0..378caf63000 100644 --- a/src/test/ui/parser/pat-ranges-1.stderr +++ b/src/test/ui/parser/pat-ranges-1.stderr @@ -1,5 +1,5 @@ error: expected one of `:`, `;`, or `=`, found `..=` - --> $DIR/pat-ranges-1.rs:6:21 + --> $DIR/pat-ranges-1.rs:4:21 | LL | let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=` | ^^^ expected one of `:`, `;`, or `=` here diff --git a/src/test/ui/parser/pat-ranges-2.rs b/src/test/ui/parser/pat-ranges-2.rs index 858d22ab79f..9f736ed328c 100644 --- a/src/test/ui/parser/pat-ranges-2.rs +++ b/src/test/ui/parser/pat-ranges-2.rs @@ -1,7 +1,5 @@ // Parsing of range patterns -// compile-flags: -Z parse-only - fn main() { let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!` } diff --git a/src/test/ui/parser/pat-ranges-2.stderr b/src/test/ui/parser/pat-ranges-2.stderr index fd92c31360e..ef8b4f94ef4 100644 --- a/src/test/ui/parser/pat-ranges-2.stderr +++ b/src/test/ui/parser/pat-ranges-2.stderr @@ -1,5 +1,5 @@ error: expected one of `::`, `:`, `;`, or `=`, found `!` - --> $DIR/pat-ranges-2.rs:6:26 + --> $DIR/pat-ranges-2.rs:4:26 | LL | let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!` | ^ expected one of `::`, `:`, `;`, or `=` here diff --git a/src/test/ui/parser/pat-ranges-3.rs b/src/test/ui/parser/pat-ranges-3.rs index 407483fd019..65da55e3bda 100644 --- a/src/test/ui/parser/pat-ranges-3.rs +++ b/src/test/ui/parser/pat-ranges-3.rs @@ -1,7 +1,5 @@ // Parsing of range patterns -// compile-flags: -Z parse-only - fn main() { let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+` } diff --git a/src/test/ui/parser/pat-ranges-3.stderr b/src/test/ui/parser/pat-ranges-3.stderr index 5f1eacc663f..f923228710b 100644 --- a/src/test/ui/parser/pat-ranges-3.stderr +++ b/src/test/ui/parser/pat-ranges-3.stderr @@ -1,5 +1,5 @@ error: expected one of `:`, `;`, or `=`, found `+` - --> $DIR/pat-ranges-3.rs:6:19 + --> $DIR/pat-ranges-3.rs:4:19 | LL | let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+` | ^ expected one of `:`, `;`, or `=` here diff --git a/src/test/ui/parser/pat-ranges-4.rs b/src/test/ui/parser/pat-ranges-4.rs index 5cc869c99d9..7f4a5f3239e 100644 --- a/src/test/ui/parser/pat-ranges-4.rs +++ b/src/test/ui/parser/pat-ranges-4.rs @@ -1,7 +1,5 @@ // Parsing of range patterns -// compile-flags: -Z parse-only - fn main() { let 10 - 3 ..= 10 = 8; //~^ error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-` diff --git a/src/test/ui/parser/pat-ranges-4.stderr b/src/test/ui/parser/pat-ranges-4.stderr index 62dea7939a1..0a1d7a1f6b8 100644 --- a/src/test/ui/parser/pat-ranges-4.stderr +++ b/src/test/ui/parser/pat-ranges-4.stderr @@ -1,5 +1,5 @@ error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-` - --> $DIR/pat-ranges-4.rs:6:12 + --> $DIR/pat-ranges-4.rs:4:12 | LL | let 10 - 3 ..= 10 = 8; | ^ expected one of `...`, `..=`, `..`, `:`, `;`, or `=` here diff --git a/src/test/ui/parser/pat-ref-enum.rs b/src/test/ui/parser/pat-ref-enum.rs index 85bb6bae9cf..412dd141de0 100644 --- a/src/test/ui/parser/pat-ref-enum.rs +++ b/src/test/ui/parser/pat-ref-enum.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn matcher(x: Option) { match x { ref Some(i) => {} //~ ERROR expected identifier, found enum pattern diff --git a/src/test/ui/parser/pat-ref-enum.stderr b/src/test/ui/parser/pat-ref-enum.stderr index 545b9494100..8729e8c5854 100644 --- a/src/test/ui/parser/pat-ref-enum.stderr +++ b/src/test/ui/parser/pat-ref-enum.stderr @@ -1,5 +1,5 @@ error: expected identifier, found enum pattern - --> $DIR/pat-ref-enum.rs:5:11 + --> $DIR/pat-ref-enum.rs:3:11 | LL | ref Some(i) => {} //~ ERROR expected identifier, found enum pattern | ^^^^ diff --git a/src/test/ui/parser/pat-tuple-1.rs b/src/test/ui/parser/pat-tuple-1.rs index 8dad6e258e4..213fbe371d4 100644 --- a/src/test/ui/parser/pat-tuple-1.rs +++ b/src/test/ui/parser/pat-tuple-1.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { match 0 { (, ..) => {} //~ ERROR expected pattern, found `,` diff --git a/src/test/ui/parser/pat-tuple-1.stderr b/src/test/ui/parser/pat-tuple-1.stderr index a867a3ee074..33c69deda42 100644 --- a/src/test/ui/parser/pat-tuple-1.stderr +++ b/src/test/ui/parser/pat-tuple-1.stderr @@ -1,5 +1,5 @@ error: expected pattern, found `,` - --> $DIR/pat-tuple-1.rs:5:10 + --> $DIR/pat-tuple-1.rs:3:10 | LL | (, ..) => {} //~ ERROR expected pattern, found `,` | ^ expected pattern diff --git a/src/test/ui/parser/pat-tuple-2.rs b/src/test/ui/parser/pat-tuple-2.rs index b52ecdf0a32..108278fa58e 100644 --- a/src/test/ui/parser/pat-tuple-2.rs +++ b/src/test/ui/parser/pat-tuple-2.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { match 0 { (pat, ..,) => {} //~ ERROR trailing comma is not permitted after `..` diff --git a/src/test/ui/parser/pat-tuple-2.stderr b/src/test/ui/parser/pat-tuple-2.stderr index 4bf495adf4e..ec123363566 100644 --- a/src/test/ui/parser/pat-tuple-2.stderr +++ b/src/test/ui/parser/pat-tuple-2.stderr @@ -1,5 +1,5 @@ error: trailing comma is not permitted after `..` - --> $DIR/pat-tuple-2.rs:5:17 + --> $DIR/pat-tuple-2.rs:3:17 | LL | (pat, ..,) => {} //~ ERROR trailing comma is not permitted after `..` | ^ diff --git a/src/test/ui/parser/pat-tuple-3.rs b/src/test/ui/parser/pat-tuple-3.rs index 1562447533d..63dcde45bfb 100644 --- a/src/test/ui/parser/pat-tuple-3.rs +++ b/src/test/ui/parser/pat-tuple-3.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { match 0 { (.., pat, ..) => {} //~ ERROR `..` can only be used once per tuple or tuple struct pattern diff --git a/src/test/ui/parser/pat-tuple-3.stderr b/src/test/ui/parser/pat-tuple-3.stderr index c015341209c..90940eb1723 100644 --- a/src/test/ui/parser/pat-tuple-3.stderr +++ b/src/test/ui/parser/pat-tuple-3.stderr @@ -1,5 +1,5 @@ error: `..` can only be used once per tuple or tuple struct pattern - --> $DIR/pat-tuple-3.rs:5:19 + --> $DIR/pat-tuple-3.rs:3:19 | LL | (.., pat, ..) => {} //~ ERROR `..` can only be used once per tuple or tuple struct pattern | ^^ diff --git a/src/test/ui/parser/pat-tuple-4.rs b/src/test/ui/parser/pat-tuple-4.rs index 70584952b3e..76f60d94bc8 100644 --- a/src/test/ui/parser/pat-tuple-4.rs +++ b/src/test/ui/parser/pat-tuple-4.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { match 0 { (.. pat) => {} //~ ERROR expected one of `)` or `,`, found `pat` diff --git a/src/test/ui/parser/pat-tuple-4.stderr b/src/test/ui/parser/pat-tuple-4.stderr index 665254c7ce6..fe4b4deaa60 100644 --- a/src/test/ui/parser/pat-tuple-4.stderr +++ b/src/test/ui/parser/pat-tuple-4.stderr @@ -1,5 +1,5 @@ error: expected one of `)` or `,`, found `pat` - --> $DIR/pat-tuple-4.rs:5:13 + --> $DIR/pat-tuple-4.rs:3:13 | LL | (.. pat) => {} //~ ERROR expected one of `)` or `,`, found `pat` | ^^^ expected one of `)` or `,` here diff --git a/src/test/ui/parser/pat-tuple-5.rs b/src/test/ui/parser/pat-tuple-5.rs index 6bd57759452..03176abaf49 100644 --- a/src/test/ui/parser/pat-tuple-5.rs +++ b/src/test/ui/parser/pat-tuple-5.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { match 0 { (pat ..) => {} //~ ERROR unexpected token: `)` diff --git a/src/test/ui/parser/pat-tuple-5.stderr b/src/test/ui/parser/pat-tuple-5.stderr index 7d12e19768a..2ca10f69760 100644 --- a/src/test/ui/parser/pat-tuple-5.stderr +++ b/src/test/ui/parser/pat-tuple-5.stderr @@ -1,5 +1,5 @@ error: unexpected token: `)` - --> $DIR/pat-tuple-5.rs:5:14 + --> $DIR/pat-tuple-5.rs:3:14 | LL | (pat ..) => {} //~ ERROR unexpected token: `)` | ^^ diff --git a/src/test/ui/parser/pub-method-macro.rs b/src/test/ui/parser/pub-method-macro.rs index 9eb64cd23d1..f04af1a0d65 100644 --- a/src/test/ui/parser/pub-method-macro.rs +++ b/src/test/ui/parser/pub-method-macro.rs @@ -1,7 +1,5 @@ // Issue #18317 -// compile-flags: -Z parse-only - mod bleh { macro_rules! defn { ($n:ident) => ( diff --git a/src/test/ui/parser/pub-method-macro.stderr b/src/test/ui/parser/pub-method-macro.stderr index 354f04cc2a6..2b4920a792f 100644 --- a/src/test/ui/parser/pub-method-macro.stderr +++ b/src/test/ui/parser/pub-method-macro.stderr @@ -1,5 +1,5 @@ error: can't qualify macro invocation with `pub` - --> $DIR/pub-method-macro.rs:19:9 + --> $DIR/pub-method-macro.rs:17:9 | LL | pub defn!(f); //~ ERROR can't qualify macro invocation with `pub` | ^^^ diff --git a/src/test/ui/parser/range-3.rs b/src/test/ui/parser/range-3.rs index 4e9c3e1e925..931839fb282 100644 --- a/src/test/ui/parser/range-3.rs +++ b/src/test/ui/parser/range-3.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Test range syntax - syntax errors. pub fn main() { diff --git a/src/test/ui/parser/range-3.stderr b/src/test/ui/parser/range-3.stderr index 9f893ac84d2..92c33487ee4 100644 --- a/src/test/ui/parser/range-3.stderr +++ b/src/test/ui/parser/range-3.stderr @@ -1,5 +1,5 @@ error: expected one of `.`, `;`, `?`, or an operator, found `..` - --> $DIR/range-3.rs:6:17 + --> $DIR/range-3.rs:4:17 | LL | let r = 1..2..3; | ^^ expected one of `.`, `;`, `?`, or an operator here diff --git a/src/test/ui/parser/range-4.rs b/src/test/ui/parser/range-4.rs index db6ae7003f8..20af9567205 100644 --- a/src/test/ui/parser/range-4.rs +++ b/src/test/ui/parser/range-4.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Test range syntax - syntax errors. pub fn main() { diff --git a/src/test/ui/parser/range-4.stderr b/src/test/ui/parser/range-4.stderr index 20915e49c01..90ec46165e7 100644 --- a/src/test/ui/parser/range-4.stderr +++ b/src/test/ui/parser/range-4.stderr @@ -1,5 +1,5 @@ error: expected one of `.`, `;`, `?`, or an operator, found `..` - --> $DIR/range-4.rs:6:16 + --> $DIR/range-4.rs:4:16 | LL | let r = ..1..2; | ^^ expected one of `.`, `;`, `?`, or an operator here diff --git a/src/test/ui/parser/range_inclusive.rs b/src/test/ui/parser/range_inclusive.rs index 1460010ec3f..bc61c5b49ea 100644 --- a/src/test/ui/parser/range_inclusive.rs +++ b/src/test/ui/parser/range_inclusive.rs @@ -1,7 +1,5 @@ // Make sure that inclusive ranges with no end point don't parse. -// compile-flags: -Z parse-only - pub fn main() { for _ in 1..= {} //~ERROR inclusive range with no end //~^HELP bounded at the end diff --git a/src/test/ui/parser/range_inclusive.stderr b/src/test/ui/parser/range_inclusive.stderr index 0a0b9e53e5b..f50b2fa49fb 100644 --- a/src/test/ui/parser/range_inclusive.stderr +++ b/src/test/ui/parser/range_inclusive.stderr @@ -1,5 +1,5 @@ error[E0586]: inclusive range with no end - --> $DIR/range_inclusive.rs:6:19 + --> $DIR/range_inclusive.rs:4:19 | LL | for _ in 1..= {} //~ERROR inclusive range with no end | ^ diff --git a/src/test/ui/parser/range_inclusive_dotdotdot.rs b/src/test/ui/parser/range_inclusive_dotdotdot.rs index 4f1572779ad..a780304c2d5 100644 --- a/src/test/ui/parser/range_inclusive_dotdotdot.rs +++ b/src/test/ui/parser/range_inclusive_dotdotdot.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error // Make sure that inclusive ranges with `...` syntax don't parse. diff --git a/src/test/ui/parser/raw-byte-string-eof.rs b/src/test/ui/parser/raw-byte-string-eof.rs index b30fe2e1fae..b74907b72b0 100644 --- a/src/test/ui/parser/raw-byte-string-eof.rs +++ b/src/test/ui/parser/raw-byte-string-eof.rs @@ -1,6 +1,3 @@ -// compile-flags: -Z parse-only - - pub fn main() { br##"a"#; //~ unterminated raw string } diff --git a/src/test/ui/parser/raw-byte-string-eof.stderr b/src/test/ui/parser/raw-byte-string-eof.stderr index 9e4595036b2..071cd6241da 100644 --- a/src/test/ui/parser/raw-byte-string-eof.stderr +++ b/src/test/ui/parser/raw-byte-string-eof.stderr @@ -1,5 +1,5 @@ error: unterminated raw string - --> $DIR/raw-byte-string-eof.rs:5:6 + --> $DIR/raw-byte-string-eof.rs:2:6 | LL | br##"a"#; //~ unterminated raw string | ^ unterminated raw string diff --git a/src/test/ui/parser/raw-byte-string-literals.rs b/src/test/ui/parser/raw-byte-string-literals.rs index 4d3f2528d68..2800e4090cf 100644 --- a/src/test/ui/parser/raw-byte-string-literals.rs +++ b/src/test/ui/parser/raw-byte-string-literals.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error pub fn main() { diff --git a/src/test/ui/parser/raw-str-delim.rs b/src/test/ui/parser/raw-str-delim.rs index a2f6b8c8f10..2f13893cecd 100644 --- a/src/test/ui/parser/raw-str-delim.rs +++ b/src/test/ui/parser/raw-str-delim.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - static s: &'static str = r#~"#"~# //~ ERROR found invalid character; only `#` is allowed in raw string delimitation ; diff --git a/src/test/ui/parser/raw-str-delim.stderr b/src/test/ui/parser/raw-str-delim.stderr index be165f41544..47fd331969d 100644 --- a/src/test/ui/parser/raw-str-delim.stderr +++ b/src/test/ui/parser/raw-str-delim.stderr @@ -1,5 +1,5 @@ error: found invalid character; only `#` is allowed in raw string delimitation: ~ - --> $DIR/raw-str-delim.rs:4:5 + --> $DIR/raw-str-delim.rs:2:5 | LL | r#~"#"~# //~ ERROR found invalid character; only `#` is allowed in raw string delimitation | ^^ diff --git a/src/test/ui/parser/raw-str-unbalanced.rs b/src/test/ui/parser/raw-str-unbalanced.rs index c38855cf35e..5a1d1be11b6 100644 --- a/src/test/ui/parser/raw-str-unbalanced.rs +++ b/src/test/ui/parser/raw-str-unbalanced.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - static s: &'static str = r#" "## //~ ERROR expected one of `.`, `;`, `?`, or an operator, found `#` diff --git a/src/test/ui/parser/raw-str-unbalanced.stderr b/src/test/ui/parser/raw-str-unbalanced.stderr index c3e0386a9fb..6dedcfb6a0a 100644 --- a/src/test/ui/parser/raw-str-unbalanced.stderr +++ b/src/test/ui/parser/raw-str-unbalanced.stderr @@ -1,5 +1,5 @@ error: expected one of `.`, `;`, `?`, or an operator, found `#` - --> $DIR/raw-str-unbalanced.rs:5:9 + --> $DIR/raw-str-unbalanced.rs:3:9 | LL | "## //~ ERROR expected one of `.`, `;`, `?`, or an operator, found `#` | ^ expected one of `.`, `;`, `?`, or an operator here diff --git a/src/test/ui/parser/raw-str-unterminated.rs b/src/test/ui/parser/raw-str-unterminated.rs index ef35aa47094..fd317295561 100644 --- a/src/test/ui/parser/raw-str-unterminated.rs +++ b/src/test/ui/parser/raw-str-unterminated.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - static s: &'static str = r#" string literal goes on and on diff --git a/src/test/ui/parser/raw-str-unterminated.stderr b/src/test/ui/parser/raw-str-unterminated.stderr index f3d4d60df10..67792eb91e5 100644 --- a/src/test/ui/parser/raw-str-unterminated.stderr +++ b/src/test/ui/parser/raw-str-unterminated.stderr @@ -1,5 +1,5 @@ error: unterminated raw string - --> $DIR/raw-str-unterminated.rs:4:5 + --> $DIR/raw-str-unterminated.rs:2:5 | LL | r#" string literal goes on | ^ unterminated raw string diff --git a/src/test/ui/parser/raw/raw-literal-keywords.rs b/src/test/ui/parser/raw/raw-literal-keywords.rs index 896cfa0cc00..f51e565c2d3 100644 --- a/src/test/ui/parser/raw/raw-literal-keywords.rs +++ b/src/test/ui/parser/raw/raw-literal-keywords.rs @@ -1,13 +1,16 @@ -// compile-flags: -Z parse-only - fn test_if() { r#if true { } //~ ERROR found `true` + //~| ERROR cannot find value `if` in this scope } fn test_struct() { r#struct Test; //~ ERROR found `Test` + //~| ERROR cannot find value `struct` in this scope } fn test_union() { r#union Test; //~ ERROR found `Test` + //~| ERROR cannot find value `union` in this scope } + +fn main() {} diff --git a/src/test/ui/parser/raw/raw-literal-keywords.stderr b/src/test/ui/parser/raw/raw-literal-keywords.stderr index b73a7e4ddd9..8465b6a6e84 100644 --- a/src/test/ui/parser/raw/raw-literal-keywords.stderr +++ b/src/test/ui/parser/raw/raw-literal-keywords.stderr @@ -1,11 +1,11 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `true` - --> $DIR/raw-literal-keywords.rs:4:10 + --> $DIR/raw-literal-keywords.rs:2:10 | LL | r#if true { } //~ ERROR found `true` | ^^^^ expected one of 8 possible tokens here error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test` - --> $DIR/raw-literal-keywords.rs:8:14 + --> $DIR/raw-literal-keywords.rs:7:14 | LL | r#struct Test; //~ ERROR found `Test` | ^^^^ expected one of 8 possible tokens here @@ -16,5 +16,24 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found LL | r#union Test; //~ ERROR found `Test` | ^^^^ expected one of 8 possible tokens here -error: aborting due to 3 previous errors +error[E0425]: cannot find value `if` in this scope + --> $DIR/raw-literal-keywords.rs:2:5 + | +LL | r#if true { } //~ ERROR found `true` + | ^^^^ not found in this scope +error[E0425]: cannot find value `struct` in this scope + --> $DIR/raw-literal-keywords.rs:7:5 + | +LL | r#struct Test; //~ ERROR found `Test` + | ^^^^^^^^ not found in this scope + +error[E0425]: cannot find value `union` in this scope + --> $DIR/raw-literal-keywords.rs:12:5 + | +LL | r#union Test; //~ ERROR found `Test` + | ^^^^^^^ not found in this scope + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/parser/raw/raw-literal-self.rs b/src/test/ui/parser/raw/raw-literal-self.rs index e033e4857ad..d7b9553d032 100644 --- a/src/test/ui/parser/raw/raw-literal-self.rs +++ b/src/test/ui/parser/raw/raw-literal-self.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn self_test(r#self: u32) { //~^ ERROR `r#self` is not currently supported. } diff --git a/src/test/ui/parser/raw/raw-literal-self.stderr b/src/test/ui/parser/raw/raw-literal-self.stderr index e5aee80142b..e64332785cc 100644 --- a/src/test/ui/parser/raw/raw-literal-self.stderr +++ b/src/test/ui/parser/raw/raw-literal-self.stderr @@ -1,5 +1,5 @@ error: `r#self` is not currently supported. - --> $DIR/raw-literal-self.rs:3:14 + --> $DIR/raw-literal-self.rs:1:14 | LL | fn self_test(r#self: u32) { | ^^^^^^ diff --git a/src/test/ui/parser/raw/raw-literal-underscore.rs b/src/test/ui/parser/raw/raw-literal-underscore.rs index d4d6bc4a2d1..bbedd395202 100644 --- a/src/test/ui/parser/raw/raw-literal-underscore.rs +++ b/src/test/ui/parser/raw/raw-literal-underscore.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn underscore_test(r#_: u32) { //~^ ERROR `r#_` is not currently supported. } diff --git a/src/test/ui/parser/raw/raw-literal-underscore.stderr b/src/test/ui/parser/raw/raw-literal-underscore.stderr index 067bfbc8033..9427b33afd8 100644 --- a/src/test/ui/parser/raw/raw-literal-underscore.stderr +++ b/src/test/ui/parser/raw/raw-literal-underscore.stderr @@ -1,5 +1,5 @@ error: `r#_` is not currently supported. - --> $DIR/raw-literal-underscore.rs:3:20 + --> $DIR/raw-literal-underscore.rs:1:20 | LL | fn underscore_test(r#_: u32) { | ^^^ diff --git a/src/test/ui/parser/raw/raw_string.rs b/src/test/ui/parser/raw/raw_string.rs index a85de0af551..84f07c4a941 100644 --- a/src/test/ui/parser/raw/raw_string.rs +++ b/src/test/ui/parser/raw/raw_string.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let x = r##"lol"#; //~^ ERROR unterminated raw string diff --git a/src/test/ui/parser/raw/raw_string.stderr b/src/test/ui/parser/raw/raw_string.stderr index 1bc8c177ec8..5572511881d 100644 --- a/src/test/ui/parser/raw/raw_string.stderr +++ b/src/test/ui/parser/raw/raw_string.stderr @@ -1,5 +1,5 @@ error: unterminated raw string - --> $DIR/raw_string.rs:4:13 + --> $DIR/raw_string.rs:2:13 | LL | let x = r##"lol"#; | ^ unterminated raw string diff --git a/src/test/ui/parser/recover-enum.rs b/src/test/ui/parser/recover-enum.rs index a12da5b0d65..204ad857165 100644 --- a/src/test/ui/parser/recover-enum.rs +++ b/src/test/ui/parser/recover-enum.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error fn main() { enum Test { diff --git a/src/test/ui/parser/recover-enum2.rs b/src/test/ui/parser/recover-enum2.rs index b96e427b16c..65a18773787 100644 --- a/src/test/ui/parser/recover-enum2.rs +++ b/src/test/ui/parser/recover-enum2.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error fn main() { enum Test { diff --git a/src/test/ui/parser/recover-struct.rs b/src/test/ui/parser/recover-struct.rs index f27320f4023..500591b2ad1 100644 --- a/src/test/ui/parser/recover-struct.rs +++ b/src/test/ui/parser/recover-struct.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error fn main() { struct Test { diff --git a/src/test/ui/parser/regions-out-of-scope-slice.rs b/src/test/ui/parser/regions-out-of-scope-slice.rs index 67084e03737..2cc9b1ac45c 100644 --- a/src/test/ui/parser/regions-out-of-scope-slice.rs +++ b/src/test/ui/parser/regions-out-of-scope-slice.rs @@ -1,7 +1,5 @@ // blk region isn't supported in the front-end -// compile-flags: -Z parse-only - fn foo(cond: bool) { // Here we will infer a type that uses the // region of the if stmt then block, but in the scope: diff --git a/src/test/ui/parser/regions-out-of-scope-slice.stderr b/src/test/ui/parser/regions-out-of-scope-slice.stderr index 385eac0eea2..026d14ca413 100644 --- a/src/test/ui/parser/regions-out-of-scope-slice.stderr +++ b/src/test/ui/parser/regions-out-of-scope-slice.stderr @@ -1,5 +1,5 @@ error: expected `:`, found `[` - --> $DIR/regions-out-of-scope-slice.rs:11:19 + --> $DIR/regions-out-of-scope-slice.rs:9:19 | LL | x = &'blk [1,2,3]; //~ ERROR expected `:`, found `[` | ^ expected `:` diff --git a/src/test/ui/parser/removed-syntax-closure-lifetime.rs b/src/test/ui/parser/removed-syntax-closure-lifetime.rs index 50fde58a357..ceac9408006 100644 --- a/src/test/ui/parser/removed-syntax-closure-lifetime.rs +++ b/src/test/ui/parser/removed-syntax-closure-lifetime.rs @@ -1,4 +1,2 @@ -// compile-flags: -Z parse-only - type closure = Box; //~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `/` diff --git a/src/test/ui/parser/removed-syntax-closure-lifetime.stderr b/src/test/ui/parser/removed-syntax-closure-lifetime.stderr index 1ad4a48a58a..f52988cdb20 100644 --- a/src/test/ui/parser/removed-syntax-closure-lifetime.stderr +++ b/src/test/ui/parser/removed-syntax-closure-lifetime.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `/` - --> $DIR/removed-syntax-closure-lifetime.rs:3:22 + --> $DIR/removed-syntax-closure-lifetime.rs:1:22 | LL | type closure = Box; | ^ expected one of 7 possible tokens here diff --git a/src/test/ui/parser/removed-syntax-enum-newtype.rs b/src/test/ui/parser/removed-syntax-enum-newtype.rs index d8eb6c4b440..518f90b2b83 100644 --- a/src/test/ui/parser/removed-syntax-enum-newtype.rs +++ b/src/test/ui/parser/removed-syntax-enum-newtype.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - enum e = isize; //~ ERROR expected one of `<`, `where`, or `{`, found `=` diff --git a/src/test/ui/parser/removed-syntax-enum-newtype.stderr b/src/test/ui/parser/removed-syntax-enum-newtype.stderr index 2d9b3df5dd2..4c710dec5ba 100644 --- a/src/test/ui/parser/removed-syntax-enum-newtype.stderr +++ b/src/test/ui/parser/removed-syntax-enum-newtype.stderr @@ -1,5 +1,5 @@ error: expected one of `<`, `where`, or `{`, found `=` - --> $DIR/removed-syntax-enum-newtype.rs:3:8 + --> $DIR/removed-syntax-enum-newtype.rs:1:8 | LL | enum e = isize; //~ ERROR expected one of `<`, `where`, or `{`, found `=` | ^ expected one of `<`, `where`, or `{` here diff --git a/src/test/ui/parser/removed-syntax-extern-const.rs b/src/test/ui/parser/removed-syntax-extern-const.rs index c3dbd39abf3..71c22e62f8e 100644 --- a/src/test/ui/parser/removed-syntax-extern-const.rs +++ b/src/test/ui/parser/removed-syntax-extern-const.rs @@ -1,6 +1,6 @@ -// compile-flags: -Z parse-only - extern { const i: isize; //~^ ERROR extern items cannot be `const` } + +fn main() {} diff --git a/src/test/ui/parser/removed-syntax-extern-const.stderr b/src/test/ui/parser/removed-syntax-extern-const.stderr index 9d8fefa5fec..2bccbd91452 100644 --- a/src/test/ui/parser/removed-syntax-extern-const.stderr +++ b/src/test/ui/parser/removed-syntax-extern-const.stderr @@ -1,5 +1,5 @@ error: extern items cannot be `const` - --> $DIR/removed-syntax-extern-const.rs:4:5 + --> $DIR/removed-syntax-extern-const.rs:2:5 | LL | const i: isize; | ^^^^^ help: try using a static value: `static` diff --git a/src/test/ui/parser/removed-syntax-field-let.rs b/src/test/ui/parser/removed-syntax-field-let.rs index 70110bd5529..3412788668a 100644 --- a/src/test/ui/parser/removed-syntax-field-let.rs +++ b/src/test/ui/parser/removed-syntax-field-let.rs @@ -1,7 +1,9 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error -struct s { +struct S { let foo: (), //~^ ERROR expected identifier, found keyword `let` //~^^ ERROR expected `:`, found `foo` } + +fn main() {} diff --git a/src/test/ui/parser/removed-syntax-field-semicolon.rs b/src/test/ui/parser/removed-syntax-field-semicolon.rs index 2ca6fbd48fb..ac28e21ae03 100644 --- a/src/test/ui/parser/removed-syntax-field-semicolon.rs +++ b/src/test/ui/parser/removed-syntax-field-semicolon.rs @@ -1,6 +1,6 @@ -// compile-flags: -Z parse-only - -struct s { +struct S { bar: (); //~^ ERROR expected `,`, or `}`, found `;` } + +fn main() {} diff --git a/src/test/ui/parser/removed-syntax-field-semicolon.stderr b/src/test/ui/parser/removed-syntax-field-semicolon.stderr index f859ec6337b..fbefeb26a50 100644 --- a/src/test/ui/parser/removed-syntax-field-semicolon.stderr +++ b/src/test/ui/parser/removed-syntax-field-semicolon.stderr @@ -1,5 +1,5 @@ error: expected `,`, or `}`, found `;` - --> $DIR/removed-syntax-field-semicolon.rs:4:12 + --> $DIR/removed-syntax-field-semicolon.rs:2:12 | LL | bar: (); | ^ diff --git a/src/test/ui/parser/removed-syntax-fixed-vec.rs b/src/test/ui/parser/removed-syntax-fixed-vec.rs index 5f70c435ba2..560efecb91c 100644 --- a/src/test/ui/parser/removed-syntax-fixed-vec.rs +++ b/src/test/ui/parser/removed-syntax-fixed-vec.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - type v = [isize * 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*` diff --git a/src/test/ui/parser/removed-syntax-fixed-vec.stderr b/src/test/ui/parser/removed-syntax-fixed-vec.stderr index 8cbed9ef924..318591e5cc0 100644 --- a/src/test/ui/parser/removed-syntax-fixed-vec.stderr +++ b/src/test/ui/parser/removed-syntax-fixed-vec.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*` - --> $DIR/removed-syntax-fixed-vec.rs:3:17 + --> $DIR/removed-syntax-fixed-vec.rs:1:17 | LL | type v = [isize * 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*` | ^ expected one of 7 possible tokens here diff --git a/src/test/ui/parser/removed-syntax-fn-sigil.rs b/src/test/ui/parser/removed-syntax-fn-sigil.rs index 77735f4fab4..725843429c0 100644 --- a/src/test/ui/parser/removed-syntax-fn-sigil.rs +++ b/src/test/ui/parser/removed-syntax-fn-sigil.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - -fn f() { +fn main() { let x: fn~() = || (); //~ ERROR expected `(`, found `~` } diff --git a/src/test/ui/parser/removed-syntax-fn-sigil.stderr b/src/test/ui/parser/removed-syntax-fn-sigil.stderr index db5b634b390..9303a67a8cc 100644 --- a/src/test/ui/parser/removed-syntax-fn-sigil.stderr +++ b/src/test/ui/parser/removed-syntax-fn-sigil.stderr @@ -1,5 +1,5 @@ error: expected `(`, found `~` - --> $DIR/removed-syntax-fn-sigil.rs:4:14 + --> $DIR/removed-syntax-fn-sigil.rs:2:14 | LL | let x: fn~() = || (); //~ ERROR expected `(`, found `~` | - ^ expected `(` diff --git a/src/test/ui/parser/removed-syntax-mode.rs b/src/test/ui/parser/removed-syntax-mode.rs index ace8dc42ab1..23851b5f70b 100644 --- a/src/test/ui/parser/removed-syntax-mode.rs +++ b/src/test/ui/parser/removed-syntax-mode.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only - fn f(+x: isize) {} //~^ ERROR expected argument name, found `+` + +fn main() {} diff --git a/src/test/ui/parser/removed-syntax-mode.stderr b/src/test/ui/parser/removed-syntax-mode.stderr index 807b47b0c0d..5e7139d6bfd 100644 --- a/src/test/ui/parser/removed-syntax-mode.stderr +++ b/src/test/ui/parser/removed-syntax-mode.stderr @@ -1,5 +1,5 @@ error: expected argument name, found `+` - --> $DIR/removed-syntax-mode.rs:3:6 + --> $DIR/removed-syntax-mode.rs:1:6 | LL | fn f(+x: isize) {} | ^ expected argument name diff --git a/src/test/ui/parser/removed-syntax-mut-vec-expr.rs b/src/test/ui/parser/removed-syntax-mut-vec-expr.rs index f68a1bcf171..2ee95db5a25 100644 --- a/src/test/ui/parser/removed-syntax-mut-vec-expr.rs +++ b/src/test/ui/parser/removed-syntax-mut-vec-expr.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - -fn f() { +fn main() { let v = [mut 1, 2, 3, 4]; //~ ERROR expected expression, found keyword `mut` } diff --git a/src/test/ui/parser/removed-syntax-mut-vec-expr.stderr b/src/test/ui/parser/removed-syntax-mut-vec-expr.stderr index 3995b6e3f0f..8164645b01b 100644 --- a/src/test/ui/parser/removed-syntax-mut-vec-expr.stderr +++ b/src/test/ui/parser/removed-syntax-mut-vec-expr.stderr @@ -1,5 +1,5 @@ error: expected expression, found keyword `mut` - --> $DIR/removed-syntax-mut-vec-expr.rs:4:14 + --> $DIR/removed-syntax-mut-vec-expr.rs:2:14 | LL | let v = [mut 1, 2, 3, 4]; //~ ERROR expected expression, found keyword `mut` | ^^^ expected expression diff --git a/src/test/ui/parser/removed-syntax-mut-vec-ty.rs b/src/test/ui/parser/removed-syntax-mut-vec-ty.rs index b492a86c9ac..923a7ea37a4 100644 --- a/src/test/ui/parser/removed-syntax-mut-vec-ty.rs +++ b/src/test/ui/parser/removed-syntax-mut-vec-ty.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - type v = [mut isize]; //~ ERROR expected type, found keyword `mut` diff --git a/src/test/ui/parser/removed-syntax-mut-vec-ty.stderr b/src/test/ui/parser/removed-syntax-mut-vec-ty.stderr index 513d896d2a2..f0eafa3d00a 100644 --- a/src/test/ui/parser/removed-syntax-mut-vec-ty.stderr +++ b/src/test/ui/parser/removed-syntax-mut-vec-ty.stderr @@ -1,5 +1,5 @@ error: expected type, found keyword `mut` - --> $DIR/removed-syntax-mut-vec-ty.rs:3:11 + --> $DIR/removed-syntax-mut-vec-ty.rs:1:11 | LL | type v = [mut isize]; //~ ERROR expected type, found keyword `mut` | ^^^ diff --git a/src/test/ui/parser/removed-syntax-ptr-lifetime.rs b/src/test/ui/parser/removed-syntax-ptr-lifetime.rs index 3457b96f36f..5b551addbc8 100644 --- a/src/test/ui/parser/removed-syntax-ptr-lifetime.rs +++ b/src/test/ui/parser/removed-syntax-ptr-lifetime.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - type bptr = &lifetime/isize; //~ ERROR expected one of `!`, `(`, `::`, `;`, or `<`, found `/` diff --git a/src/test/ui/parser/removed-syntax-ptr-lifetime.stderr b/src/test/ui/parser/removed-syntax-ptr-lifetime.stderr index 5b61315add1..689ed35668e 100644 --- a/src/test/ui/parser/removed-syntax-ptr-lifetime.stderr +++ b/src/test/ui/parser/removed-syntax-ptr-lifetime.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `(`, `::`, `;`, or `<`, found `/` - --> $DIR/removed-syntax-ptr-lifetime.rs:3:22 + --> $DIR/removed-syntax-ptr-lifetime.rs:1:22 | LL | type bptr = &lifetime/isize; //~ ERROR expected one of `!`, `(`, `::`, `;`, or `<`, found `/` | ^ expected one of `!`, `(`, `::`, `;`, or `<` here diff --git a/src/test/ui/parser/removed-syntax-record.rs b/src/test/ui/parser/removed-syntax-record.rs index b16a741bee1..d1d91c8f7dc 100644 --- a/src/test/ui/parser/removed-syntax-record.rs +++ b/src/test/ui/parser/removed-syntax-record.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - type t = { f: () }; //~ ERROR expected type, found `{` diff --git a/src/test/ui/parser/removed-syntax-record.stderr b/src/test/ui/parser/removed-syntax-record.stderr index 13dfc3dcfa1..f9b98596ae3 100644 --- a/src/test/ui/parser/removed-syntax-record.stderr +++ b/src/test/ui/parser/removed-syntax-record.stderr @@ -1,5 +1,5 @@ error: expected type, found `{` - --> $DIR/removed-syntax-record.rs:3:10 + --> $DIR/removed-syntax-record.rs:1:10 | LL | type t = { f: () }; //~ ERROR expected type, found `{` | ^ diff --git a/src/test/ui/parser/removed-syntax-static-fn.rs b/src/test/ui/parser/removed-syntax-static-fn.rs index 3cb1cd4f6b3..df3964196b8 100644 --- a/src/test/ui/parser/removed-syntax-static-fn.rs +++ b/src/test/ui/parser/removed-syntax-static-fn.rs @@ -1,4 +1,3 @@ -// compile-flags: -Z parse-only // ignore-tidy-linelength struct S; @@ -7,3 +6,5 @@ impl S { static fn f() {} } //~^^ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, + +fn main() {} diff --git a/src/test/ui/parser/removed-syntax-static-fn.stderr b/src/test/ui/parser/removed-syntax-static-fn.stderr index ab42e0bbc46..84e0432c48c 100644 --- a/src/test/ui/parser/removed-syntax-static-fn.stderr +++ b/src/test/ui/parser/removed-syntax-static-fn.stderr @@ -1,5 +1,5 @@ error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `static` - --> $DIR/removed-syntax-static-fn.rs:7:5 + --> $DIR/removed-syntax-static-fn.rs:6:5 | LL | impl S { | - expected one of 11 possible tokens here diff --git a/src/test/ui/parser/removed-syntax-uniq-mut-expr.rs b/src/test/ui/parser/removed-syntax-uniq-mut-expr.rs index 95166bd3875..08ef4b43269 100644 --- a/src/test/ui/parser/removed-syntax-uniq-mut-expr.rs +++ b/src/test/ui/parser/removed-syntax-uniq-mut-expr.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - -fn f() { +fn main() { let a_box = box mut 42; //~ ERROR expected expression, found keyword `mut` } diff --git a/src/test/ui/parser/removed-syntax-uniq-mut-expr.stderr b/src/test/ui/parser/removed-syntax-uniq-mut-expr.stderr index 8b2dbb3267b..90d0764def0 100644 --- a/src/test/ui/parser/removed-syntax-uniq-mut-expr.stderr +++ b/src/test/ui/parser/removed-syntax-uniq-mut-expr.stderr @@ -1,5 +1,5 @@ error: expected expression, found keyword `mut` - --> $DIR/removed-syntax-uniq-mut-expr.rs:4:21 + --> $DIR/removed-syntax-uniq-mut-expr.rs:2:21 | LL | let a_box = box mut 42; //~ ERROR expected expression, found keyword `mut` | ^^^ expected expression diff --git a/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs b/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs index 7d9b8af734c..12de76d9d6d 100644 --- a/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs +++ b/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - type mut_box = Box; //~ ERROR expected one of `>`, lifetime, or type, found `mut` diff --git a/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr b/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr index dc160824062..0177b19d74e 100644 --- a/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr +++ b/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr @@ -1,5 +1,5 @@ error: expected one of `>`, lifetime, or type, found `mut` - --> $DIR/removed-syntax-uniq-mut-ty.rs:3:20 + --> $DIR/removed-syntax-uniq-mut-ty.rs:1:20 | LL | type mut_box = Box; //~ ERROR expected one of `>`, lifetime, or type, found `mut` | ^^^ expected one of `>`, lifetime, or type here diff --git a/src/test/ui/parser/removed-syntax-with-1.rs b/src/test/ui/parser/removed-syntax-with-1.rs index a08baf622d4..57cbe8d5be6 100644 --- a/src/test/ui/parser/removed-syntax-with-1.rs +++ b/src/test/ui/parser/removed-syntax-with-1.rs @@ -1,6 +1,4 @@ -// compile-flags: -Z parse-only - -fn removed_with() { +fn main() { struct S { foo: (), bar: (), @@ -9,4 +7,5 @@ fn removed_with() { let a = S { foo: (), bar: () }; let b = S { foo: () with a }; //~^ ERROR expected one of `,`, `.`, `?`, `}`, or an operator, found `with` + //~| ERROR missing field `bar` in initializer of `main::S` } diff --git a/src/test/ui/parser/removed-syntax-with-1.stderr b/src/test/ui/parser/removed-syntax-with-1.stderr index 6a69cdf8e8f..77ed4fcea51 100644 --- a/src/test/ui/parser/removed-syntax-with-1.stderr +++ b/src/test/ui/parser/removed-syntax-with-1.stderr @@ -1,8 +1,15 @@ error: expected one of `,`, `.`, `?`, `}`, or an operator, found `with` - --> $DIR/removed-syntax-with-1.rs:10:25 + --> $DIR/removed-syntax-with-1.rs:8:25 | LL | let b = S { foo: () with a }; | ^^^^ expected one of `,`, `.`, `?`, `}`, or an operator here -error: aborting due to previous error +error[E0063]: missing field `bar` in initializer of `main::S` + --> $DIR/removed-syntax-with-1.rs:8:13 + | +LL | let b = S { foo: () with a }; + | ^ missing `bar` +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0063`. diff --git a/src/test/ui/parser/removed-syntax-with-2.rs b/src/test/ui/parser/removed-syntax-with-2.rs index 22b9ba2a41d..11db391c548 100644 --- a/src/test/ui/parser/removed-syntax-with-2.rs +++ b/src/test/ui/parser/removed-syntax-with-2.rs @@ -1,6 +1,4 @@ -// compile-flags: -Z parse-only - -fn removed_with() { +fn main() { struct S { foo: (), bar: (), @@ -9,4 +7,6 @@ fn removed_with() { let a = S { foo: (), bar: () }; let b = S { foo: (), with a }; //~^ ERROR expected one of `,` or `}`, found `a` + //~| ERROR cannot find value `with` in this scope + //~| ERROR struct `main::S` has no field named `with` } diff --git a/src/test/ui/parser/removed-syntax-with-2.stderr b/src/test/ui/parser/removed-syntax-with-2.stderr index ade56efcc89..5642d2f45ff 100644 --- a/src/test/ui/parser/removed-syntax-with-2.stderr +++ b/src/test/ui/parser/removed-syntax-with-2.stderr @@ -1,8 +1,24 @@ error: expected one of `,` or `}`, found `a` - --> $DIR/removed-syntax-with-2.rs:10:31 + --> $DIR/removed-syntax-with-2.rs:8:31 | LL | let b = S { foo: (), with a }; | ^ expected one of `,` or `}` here -error: aborting due to previous error +error[E0425]: cannot find value `with` in this scope + --> $DIR/removed-syntax-with-2.rs:8:26 + | +LL | let b = S { foo: (), with a }; + | ^^^^ not found in this scope +error[E0560]: struct `main::S` has no field named `with` + --> $DIR/removed-syntax-with-2.rs:8:26 + | +LL | let b = S { foo: (), with a }; + | ^^^^ `main::S` does not have this field + | + = note: available fields are: `foo`, `bar` + +error: aborting due to 3 previous errors + +Some errors occurred: E0425, E0560. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/ui/parser/require-parens-for-chained-comparison.rs b/src/test/ui/parser/require-parens-for-chained-comparison.rs index 912da96f2da..525be5d20e2 100644 --- a/src/test/ui/parser/require-parens-for-chained-comparison.rs +++ b/src/test/ui/parser/require-parens-for-chained-comparison.rs @@ -1,6 +1,5 @@ -// compile-flags: -Z parse-only - fn f() {} +struct X; fn main() { false == false == false; @@ -8,9 +7,12 @@ fn main() { false == 0 < 2; //~^ ERROR: chained comparison operators require parentheses + //~| ERROR: mismatched types + //~| ERROR: mismatched types f(); //~^ ERROR: chained comparison operators require parentheses + //~| ERROR: binary operation `<` cannot be applied to type `fn() {f::<_>}` //~| HELP: use `::<...>` instead of `<...>` //~| HELP: or use `(...)` } diff --git a/src/test/ui/parser/require-parens-for-chained-comparison.stderr b/src/test/ui/parser/require-parens-for-chained-comparison.stderr index ca33ed986b0..4597b143215 100644 --- a/src/test/ui/parser/require-parens-for-chained-comparison.stderr +++ b/src/test/ui/parser/require-parens-for-chained-comparison.stderr @@ -1,17 +1,17 @@ error: chained comparison operators require parentheses - --> $DIR/require-parens-for-chained-comparison.rs:6:11 + --> $DIR/require-parens-for-chained-comparison.rs:5:11 | LL | false == false == false; | ^^^^^^^^^^^^^^^^^ error: chained comparison operators require parentheses - --> $DIR/require-parens-for-chained-comparison.rs:9:11 + --> $DIR/require-parens-for-chained-comparison.rs:8:11 | LL | false == 0 < 2; | ^^^^^^^^ error: chained comparison operators require parentheses - --> $DIR/require-parens-for-chained-comparison.rs:12:6 + --> $DIR/require-parens-for-chained-comparison.rs:13:6 | LL | f(); | ^^^^ @@ -19,5 +19,33 @@ LL | f(); = help: use `::<...>` instead of `<...>` if you meant to specify type arguments = help: or use `(...)` if you meant to specify fn arguments -error: aborting due to 3 previous errors +error[E0308]: mismatched types + --> $DIR/require-parens-for-chained-comparison.rs:8:14 + | +LL | false == 0 < 2; + | ^ expected bool, found integer + | + = note: expected type `bool` + found type `{integer}` +error[E0308]: mismatched types + --> $DIR/require-parens-for-chained-comparison.rs:8:18 + | +LL | false == 0 < 2; + | ^ expected bool, found integer + | + = note: expected type `bool` + found type `{integer}` + +error[E0369]: binary operation `<` cannot be applied to type `fn() {f::<_>}` + --> $DIR/require-parens-for-chained-comparison.rs:13:5 + | +LL | f(); + | ^^^ + | + = note: an implementation of `std::cmp::PartialOrd` might be missing for `fn() {f::<_>}` + +error: aborting due to 6 previous errors + +Some errors occurred: E0308, E0369. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/parser/struct-field-numeric-shorthand.rs b/src/test/ui/parser/struct-field-numeric-shorthand.rs index a6ed6fc69e6..914588f51e1 100644 --- a/src/test/ui/parser/struct-field-numeric-shorthand.rs +++ b/src/test/ui/parser/struct-field-numeric-shorthand.rs @@ -1,7 +1,6 @@ -// compile-flags: -Z parse-only - struct Rgb(u8, u8, u8); fn main() { let _ = Rgb { 0, 1, 2 }; //~ ERROR expected identifier, found `0` + //~| ERROR missing fields `0`, `1`, `2` in initializer of `Rgb` } diff --git a/src/test/ui/parser/struct-field-numeric-shorthand.stderr b/src/test/ui/parser/struct-field-numeric-shorthand.stderr index 29fc654c971..f5dc226934e 100644 --- a/src/test/ui/parser/struct-field-numeric-shorthand.stderr +++ b/src/test/ui/parser/struct-field-numeric-shorthand.stderr @@ -1,10 +1,17 @@ error: expected identifier, found `0` - --> $DIR/struct-field-numeric-shorthand.rs:6:19 + --> $DIR/struct-field-numeric-shorthand.rs:4:19 | LL | let _ = Rgb { 0, 1, 2 }; //~ ERROR expected identifier, found `0` | --- ^ expected identifier | | | while parsing this struct -error: aborting due to previous error +error[E0063]: missing fields `0`, `1`, `2` in initializer of `Rgb` + --> $DIR/struct-field-numeric-shorthand.rs:4:13 + | +LL | let _ = Rgb { 0, 1, 2 }; //~ ERROR expected identifier, found `0` + | ^^^ missing `0`, `1`, `2` +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0063`. diff --git a/src/test/ui/parser/struct-literal-in-for.rs b/src/test/ui/parser/struct-literal-in-for.rs index 0dec3d375c3..526b5e75c45 100644 --- a/src/test/ui/parser/struct-literal-in-for.rs +++ b/src/test/ui/parser/struct-literal-in-for.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - struct Foo { x: isize, } @@ -11,7 +9,7 @@ impl Foo { } fn main() { - for x in Foo { + for x in Foo { //~ ERROR expected value, found struct `Foo` x: 3 //~ ERROR expected type, found `3` }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` println!("yo"); diff --git a/src/test/ui/parser/struct-literal-in-for.stderr b/src/test/ui/parser/struct-literal-in-for.stderr index 3117fdcc148..38a5e22e3f7 100644 --- a/src/test/ui/parser/struct-literal-in-for.stderr +++ b/src/test/ui/parser/struct-literal-in-for.stderr @@ -1,14 +1,21 @@ error: expected type, found `3` - --> $DIR/struct-literal-in-for.rs:15:12 + --> $DIR/struct-literal-in-for.rs:13:12 | LL | x: 3 //~ ERROR expected type, found `3` | ^ expecting a type here because of type ascription error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{` - --> $DIR/struct-literal-in-for.rs:16:12 + --> $DIR/struct-literal-in-for.rs:14:12 | LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` | ^ expected one of `.`, `;`, `?`, `}`, or an operator here -error: aborting due to 2 previous errors +error[E0423]: expected value, found struct `Foo` + --> $DIR/struct-literal-in-for.rs:12:14 + | +LL | for x in Foo { //~ ERROR expected value, found struct `Foo` + | ^^^ did you mean `(Foo { /* fields */ })`? +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/ui/parser/struct-literal-in-if.rs b/src/test/ui/parser/struct-literal-in-if.rs index f69b9b1cbcc..362a71c577f 100644 --- a/src/test/ui/parser/struct-literal-in-if.rs +++ b/src/test/ui/parser/struct-literal-in-if.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - struct Foo { x: isize, } @@ -11,7 +9,7 @@ impl Foo { } fn main() { - if Foo { + if Foo { //~ ERROR expected value, found struct `Foo` x: 3 //~ ERROR expected type, found `3` }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` println!("yo"); diff --git a/src/test/ui/parser/struct-literal-in-if.stderr b/src/test/ui/parser/struct-literal-in-if.stderr index 55018a8072d..49b9a52aff9 100644 --- a/src/test/ui/parser/struct-literal-in-if.stderr +++ b/src/test/ui/parser/struct-literal-in-if.stderr @@ -1,14 +1,21 @@ error: expected type, found `3` - --> $DIR/struct-literal-in-if.rs:15:12 + --> $DIR/struct-literal-in-if.rs:13:12 | LL | x: 3 //~ ERROR expected type, found `3` | ^ expecting a type here because of type ascription error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{` - --> $DIR/struct-literal-in-if.rs:16:12 + --> $DIR/struct-literal-in-if.rs:14:12 | LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` | ^ expected one of `.`, `;`, `?`, `}`, or an operator here -error: aborting due to 2 previous errors +error[E0423]: expected value, found struct `Foo` + --> $DIR/struct-literal-in-if.rs:12:8 + | +LL | if Foo { //~ ERROR expected value, found struct `Foo` + | ^^^ did you mean `(Foo { /* fields */ })`? +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/ui/parser/struct-literal-in-match-discriminant.rs b/src/test/ui/parser/struct-literal-in-match-discriminant.rs index d14276fbf78..35a11090351 100644 --- a/src/test/ui/parser/struct-literal-in-match-discriminant.rs +++ b/src/test/ui/parser/struct-literal-in-match-discriminant.rs @@ -1,15 +1,13 @@ -// compile-flags: -Z parse-only - struct Foo { x: isize, } fn main() { - match Foo { + match Foo { //~ ERROR expected value, found struct `Foo` x: 3 //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `:` } { - Foo { - x: x + Foo { //~ ERROR mismatched types + x: x //~ ERROR cannot find value `x` in this scope } => {} //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `=>` } } diff --git a/src/test/ui/parser/struct-literal-in-match-discriminant.stderr b/src/test/ui/parser/struct-literal-in-match-discriminant.stderr index 680258b1d04..64ddde0e9e9 100644 --- a/src/test/ui/parser/struct-literal-in-match-discriminant.stderr +++ b/src/test/ui/parser/struct-literal-in-match-discriminant.stderr @@ -1,14 +1,42 @@ error: expected one of `=>`, `@`, `if`, or `|`, found `:` - --> $DIR/struct-literal-in-match-discriminant.rs:9:10 + --> $DIR/struct-literal-in-match-discriminant.rs:7:10 | LL | x: 3 //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `:` | ^ expected one of `=>`, `@`, `if`, or `|` here error: expected one of `.`, `;`, `?`, `}`, or an operator, found `=>` - --> $DIR/struct-literal-in-match-discriminant.rs:13:11 + --> $DIR/struct-literal-in-match-discriminant.rs:11:11 | LL | } => {} //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `=>` | ^^ expected one of `.`, `;`, `?`, `}`, or an operator here -error: aborting due to 2 previous errors +error[E0423]: expected value, found struct `Foo` + --> $DIR/struct-literal-in-match-discriminant.rs:6:11 + | +LL | match Foo { //~ ERROR expected value, found struct `Foo` + | ^^^ did you mean `(Foo { /* fields */ })`? +error[E0425]: cannot find value `x` in this scope + --> $DIR/struct-literal-in-match-discriminant.rs:10:16 + | +LL | x: x //~ ERROR cannot find value `x` in this scope + | ^ not found in this scope + +error[E0308]: mismatched types + --> $DIR/struct-literal-in-match-discriminant.rs:9:9 + | +LL | fn main() { + | - expected `()` because of default return type +... +LL | / Foo { //~ ERROR mismatched types +LL | | x: x //~ ERROR cannot find value `x` in this scope +LL | | } => {} //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `=>` + | |_________^ expected (), found struct `Foo` + | + = note: expected type `()` + found type `Foo` + +error: aborting due to 5 previous errors + +Some errors occurred: E0308, E0423, E0425. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/parser/struct-literal-in-while.rs b/src/test/ui/parser/struct-literal-in-while.rs index cd3e640b67c..561cdcea089 100644 --- a/src/test/ui/parser/struct-literal-in-while.rs +++ b/src/test/ui/parser/struct-literal-in-while.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - struct Foo { x: isize, } @@ -11,9 +9,10 @@ impl Foo { } fn main() { - while Foo { + while Foo { //~ ERROR expected value, found struct `Foo` x: 3 //~ ERROR expected type, found `3` }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + //~| ERROR no method named `hi` found for type `()` in the current scope println!("yo"); } } diff --git a/src/test/ui/parser/struct-literal-in-while.stderr b/src/test/ui/parser/struct-literal-in-while.stderr index 4de05f0ebde..9a6ab81e7c0 100644 --- a/src/test/ui/parser/struct-literal-in-while.stderr +++ b/src/test/ui/parser/struct-literal-in-while.stderr @@ -1,14 +1,28 @@ error: expected type, found `3` - --> $DIR/struct-literal-in-while.rs:15:12 + --> $DIR/struct-literal-in-while.rs:13:12 | LL | x: 3 //~ ERROR expected type, found `3` | ^ expecting a type here because of type ascription error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{` - --> $DIR/struct-literal-in-while.rs:16:12 + --> $DIR/struct-literal-in-while.rs:14:12 | LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` | ^ expected one of `.`, `;`, `?`, `}`, or an operator here -error: aborting due to 2 previous errors +error[E0423]: expected value, found struct `Foo` + --> $DIR/struct-literal-in-while.rs:12:11 + | +LL | while Foo { //~ ERROR expected value, found struct `Foo` + | ^^^ did you mean `(Foo { /* fields */ })`? +error[E0599]: no method named `hi` found for type `()` in the current scope + --> $DIR/struct-literal-in-while.rs:14:7 + | +LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + | ^^ + +error: aborting due to 4 previous errors + +Some errors occurred: E0423, E0599. +For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/parser/struct-literal-restrictions-in-lamda.rs b/src/test/ui/parser/struct-literal-restrictions-in-lamda.rs index 743b7733a22..e5049082ab0 100644 --- a/src/test/ui/parser/struct-literal-restrictions-in-lamda.rs +++ b/src/test/ui/parser/struct-literal-restrictions-in-lamda.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - struct Foo { x: isize, } @@ -11,9 +9,10 @@ impl Foo { } fn main() { - while || Foo { + while || Foo { //~ ERROR expected value, found struct `Foo` x: 3 //~ ERROR expected type, found `3` }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + //~| ERROR no method named `hi` found for type `()` in the current scope println!("yo"); } } diff --git a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr index 0968009057f..2303df93810 100644 --- a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr +++ b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr @@ -1,14 +1,28 @@ error: expected type, found `3` - --> $DIR/struct-literal-restrictions-in-lamda.rs:15:12 + --> $DIR/struct-literal-restrictions-in-lamda.rs:13:12 | LL | x: 3 //~ ERROR expected type, found `3` | ^ expecting a type here because of type ascription error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{` - --> $DIR/struct-literal-restrictions-in-lamda.rs:16:12 + --> $DIR/struct-literal-restrictions-in-lamda.rs:14:12 | LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` | ^ expected one of `.`, `;`, `?`, `}`, or an operator here -error: aborting due to 2 previous errors +error[E0423]: expected value, found struct `Foo` + --> $DIR/struct-literal-restrictions-in-lamda.rs:12:14 + | +LL | while || Foo { //~ ERROR expected value, found struct `Foo` + | ^^^ did you mean `(Foo { /* fields */ })`? +error[E0599]: no method named `hi` found for type `()` in the current scope + --> $DIR/struct-literal-restrictions-in-lamda.rs:14:7 + | +LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + | ^^ + +error: aborting due to 4 previous errors + +Some errors occurred: E0423, E0599. +For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/parser/tag-variant-disr-non-nullary.rs b/src/test/ui/parser/tag-variant-disr-non-nullary.rs index 55ab871dd33..35a36cbbf91 100644 --- a/src/test/ui/parser/tag-variant-disr-non-nullary.rs +++ b/src/test/ui/parser/tag-variant-disr-non-nullary.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - //error-pattern: discriminator values can only be used with a field-less enum enum color { @@ -10,3 +8,5 @@ enum color { white = 0xffffff, other (str), } + +fn main() {} diff --git a/src/test/ui/parser/tag-variant-disr-non-nullary.stderr b/src/test/ui/parser/tag-variant-disr-non-nullary.stderr index 6bb393a1910..aa45ea4ac26 100644 --- a/src/test/ui/parser/tag-variant-disr-non-nullary.stderr +++ b/src/test/ui/parser/tag-variant-disr-non-nullary.stderr @@ -1,5 +1,5 @@ error: discriminator values can only be used with a field-less enum - --> $DIR/tag-variant-disr-non-nullary.rs:10:13 + --> $DIR/tag-variant-disr-non-nullary.rs:8:13 | LL | white = 0xffffff, | ^^^^^^^^ diff --git a/src/test/ui/parser/trailing-carriage-return-in-string.rs b/src/test/ui/parser/trailing-carriage-return-in-string.rs index cbc919516c1..8abf2624e4f 100644 --- a/src/test/ui/parser/trailing-carriage-return-in-string.rs +++ b/src/test/ui/parser/trailing-carriage-return-in-string.rs @@ -1,7 +1,6 @@ -// compile-flags: -Z parse-only +// Issue #11669 // ignore-tidy-cr -// Issue #11669 fn main() { // \r\n diff --git a/src/test/ui/parser/trailing-carriage-return-in-string.stderr b/src/test/ui/parser/trailing-carriage-return-in-string.stderr index d019bc7d3e4..972e4296da3 100644 --- a/src/test/ui/parser/trailing-carriage-return-in-string.stderr +++ b/src/test/ui/parser/trailing-carriage-return-in-string.stderr @@ -1,11 +1,11 @@ error: unknown character escape: /r - --> $DIR/trailing-carriage-return-in-string.rs:11:25 + --> $DIR/trailing-carriage-return-in-string.rs:10:25 | LL | let bad = "This is / a test"; | ^ | help: this is an isolated carriage return; consider checking your editor and version control settings - --> $DIR/trailing-carriage-return-in-string.rs:11:25 + --> $DIR/trailing-carriage-return-in-string.rs:10:25 | LL | let bad = "This is / a test"; | ^ diff --git a/src/test/ui/parser/trailing-plus-in-bounds.rs b/src/test/ui/parser/trailing-plus-in-bounds.rs index 1204f05e9f1..153f942b978 100644 --- a/src/test/ui/parser/trailing-plus-in-bounds.rs +++ b/src/test/ui/parser/trailing-plus-in-bounds.rs @@ -1,5 +1,7 @@ // compile-pass -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error + +#![feature(box_syntax)] use std::fmt::Debug; diff --git a/src/test/ui/parser/trait-bounds-not-on-impl.rs b/src/test/ui/parser/trait-bounds-not-on-impl.rs index f89dbb0ed8f..d77ff80ca25 100644 --- a/src/test/ui/parser/trait-bounds-not-on-impl.rs +++ b/src/test/ui/parser/trait-bounds-not-on-impl.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error trait Foo { } diff --git a/src/test/ui/parser/trait-object-bad-parens.rs b/src/test/ui/parser/trait-object-bad-parens.rs index 4d732b3a7c8..0f1f49a521b 100644 --- a/src/test/ui/parser/trait-object-bad-parens.rs +++ b/src/test/ui/parser/trait-object-bad-parens.rs @@ -1,12 +1,16 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error + +#![feature(optin_builtin_traits)] + +auto trait Auto {} fn main() { - let _: Box<((Copy)) + Copy>; - //~^ ERROR expected a path on the left-hand side of `+`, not `((Copy))` - let _: Box<(Copy + Copy) + Copy>; - //~^ ERROR expected a path on the left-hand side of `+`, not `(Copy + Copy)` - let _: Box<(Copy +) + Copy>; - //~^ ERROR expected a path on the left-hand side of `+`, not `(Copy)` - let _: Box<(dyn Copy) + Copy>; - //~^ ERROR expected a path on the left-hand side of `+`, not `(dyn Copy)` + let _: Box<((Auto)) + Auto>; + //~^ ERROR expected a path on the left-hand side of `+`, not `((Auto))` + let _: Box<(Auto + Auto) + Auto>; + //~^ ERROR expected a path on the left-hand side of `+`, not `(Auto + Auto)` + let _: Box<(Auto +) + Auto>; + //~^ ERROR expected a path on the left-hand side of `+`, not `(Auto)` + let _: Box<(dyn Auto) + Auto>; + //~^ ERROR expected a path on the left-hand side of `+`, not `(dyn Auto)` } diff --git a/src/test/ui/parser/trait-object-bad-parens.stderr b/src/test/ui/parser/trait-object-bad-parens.stderr index e9f1dc57919..74e484eebee 100644 --- a/src/test/ui/parser/trait-object-bad-parens.stderr +++ b/src/test/ui/parser/trait-object-bad-parens.stderr @@ -1,25 +1,25 @@ -error[E0178]: expected a path on the left-hand side of `+`, not `((Copy))` - --> $DIR/trait-object-bad-parens.rs:4:16 - | -LL | let _: Box<((Copy)) + Copy>; - | ^^^^^^^^^^^^^^^ expected a path - -error[E0178]: expected a path on the left-hand side of `+`, not `(Copy + Copy)` - --> $DIR/trait-object-bad-parens.rs:6:16 - | -LL | let _: Box<(Copy + Copy) + Copy>; - | ^^^^^^^^^^^^^^^^^^^^ expected a path - -error[E0178]: expected a path on the left-hand side of `+`, not `(Copy)` +error[E0178]: expected a path on the left-hand side of `+`, not `((Auto))` --> $DIR/trait-object-bad-parens.rs:8:16 | -LL | let _: Box<(Copy +) + Copy>; +LL | let _: Box<((Auto)) + Auto>; | ^^^^^^^^^^^^^^^ expected a path -error[E0178]: expected a path on the left-hand side of `+`, not `(dyn Copy)` +error[E0178]: expected a path on the left-hand side of `+`, not `(Auto + Auto)` --> $DIR/trait-object-bad-parens.rs:10:16 | -LL | let _: Box<(dyn Copy) + Copy>; +LL | let _: Box<(Auto + Auto) + Auto>; + | ^^^^^^^^^^^^^^^^^^^^ expected a path + +error[E0178]: expected a path on the left-hand side of `+`, not `(Auto)` + --> $DIR/trait-object-bad-parens.rs:12:16 + | +LL | let _: Box<(Auto +) + Auto>; + | ^^^^^^^^^^^^^^^ expected a path + +error[E0178]: expected a path on the left-hand side of `+`, not `(dyn Auto)` + --> $DIR/trait-object-bad-parens.rs:14:16 + | +LL | let _: Box<(dyn Auto) + Auto>; | ^^^^^^^^^^^^^^^^^ expected a path error: aborting due to 4 previous errors diff --git a/src/test/ui/parser/trait-object-lifetime-parens.rs b/src/test/ui/parser/trait-object-lifetime-parens.rs index fef8352e93b..b188e14778b 100644 --- a/src/test/ui/parser/trait-object-lifetime-parens.rs +++ b/src/test/ui/parser/trait-object-lifetime-parens.rs @@ -1,8 +1,12 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error -fn f() {} //~ ERROR parenthesized lifetime bounds are not supported +trait Trait {} -fn main() { - let _: Box; //~ ERROR parenthesized lifetime bounds are not supported - let _: Box<('a) + Copy>; //~ ERROR expected type, found `'a` +fn f<'a, T: Trait + ('a)>() {} //~ ERROR parenthesized lifetime bounds are not supported + +fn check<'a>() { + let _: Box; //~ ERROR parenthesized lifetime bounds are not supported + let _: Box<('a) + Trait>; //~ ERROR expected type, found `'a` } + +fn main() {} diff --git a/src/test/ui/parser/trait-object-lifetime-parens.stderr b/src/test/ui/parser/trait-object-lifetime-parens.stderr index e5a201a7abd..a9b542ddcc4 100644 --- a/src/test/ui/parser/trait-object-lifetime-parens.stderr +++ b/src/test/ui/parser/trait-object-lifetime-parens.stderr @@ -1,19 +1,19 @@ error: parenthesized lifetime bounds are not supported - --> $DIR/trait-object-lifetime-parens.rs:3:19 + --> $DIR/trait-object-lifetime-parens.rs:5:24 | -LL | fn f() {} //~ ERROR parenthesized lifetime bounds are not supported - | ^ +LL | fn f<'a, T: Trait + ('a)>() {} //~ ERROR parenthesized lifetime bounds are not supported + | ^ error: parenthesized lifetime bounds are not supported - --> $DIR/trait-object-lifetime-parens.rs:6:26 + --> $DIR/trait-object-lifetime-parens.rs:8:27 | -LL | let _: Box; //~ ERROR parenthesized lifetime bounds are not supported - | ^ +LL | let _: Box; //~ ERROR parenthesized lifetime bounds are not supported + | ^ error: expected type, found `'a` - --> $DIR/trait-object-lifetime-parens.rs:7:17 + --> $DIR/trait-object-lifetime-parens.rs:9:17 | -LL | let _: Box<('a) + Copy>; //~ ERROR expected type, found `'a` +LL | let _: Box<('a) + Trait>; //~ ERROR expected type, found `'a` | - ^^ | | | while parsing the type for `_` diff --git a/src/test/ui/parser/trait-object-polytrait-priority.rs b/src/test/ui/parser/trait-object-polytrait-priority.rs index e08c3bc3ac5..40d2ad52c35 100644 --- a/src/test/ui/parser/trait-object-polytrait-priority.rs +++ b/src/test/ui/parser/trait-object-polytrait-priority.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - trait Trait<'a> {} fn main() { diff --git a/src/test/ui/parser/trait-object-polytrait-priority.stderr b/src/test/ui/parser/trait-object-polytrait-priority.stderr index a6add6079ce..5e2a35ea60c 100644 --- a/src/test/ui/parser/trait-object-polytrait-priority.stderr +++ b/src/test/ui/parser/trait-object-polytrait-priority.stderr @@ -1,5 +1,5 @@ error[E0178]: expected a path on the left-hand side of `+`, not `&for<'a> Trait<'a>` - --> $DIR/trait-object-polytrait-priority.rs:6:12 + --> $DIR/trait-object-polytrait-priority.rs:4:12 | LL | let _: &for<'a> Trait<'a> + 'static; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try adding parentheses: `&(for<'a> Trait<'a> + 'static)` diff --git a/src/test/ui/parser/trait-object-trait-parens.rs b/src/test/ui/parser/trait-object-trait-parens.rs index 3802d35aa1d..2bbc5800015 100644 --- a/src/test/ui/parser/trait-object-trait-parens.rs +++ b/src/test/ui/parser/trait-object-trait-parens.rs @@ -1,10 +1,12 @@ -// compile-pass -// compile-flags: -Z parse-only +trait Trait<'a> {} fn f Trait<'a>)>() {} fn main() { let _: Box<(Copy) + (?Sized) + (for<'a> Trait<'a>)>; + //~^ ERROR `?Trait` is not permitted in trait object types let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>; let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>; + //~^ ERROR `?Trait` is not permitted in trait object types + //~| ERROR use of undeclared lifetime name `'a` } diff --git a/src/test/ui/parser/trait-object-trait-parens.stderr b/src/test/ui/parser/trait-object-trait-parens.stderr new file mode 100644 index 00000000000..36494b76539 --- /dev/null +++ b/src/test/ui/parser/trait-object-trait-parens.stderr @@ -0,0 +1,21 @@ +error: `?Trait` is not permitted in trait object types + --> $DIR/trait-object-trait-parens.rs:6:25 + | +LL | let _: Box<(Copy) + (?Sized) + (for<'a> Trait<'a>)>; + | ^^^^^^^^ + +error: `?Trait` is not permitted in trait object types + --> $DIR/trait-object-trait-parens.rs:9:47 + | +LL | let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>; + | ^^^^^^^^ + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/trait-object-trait-parens.rs:9:31 + | +LL | let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>; + | ^^ undeclared lifetime + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0261`. diff --git a/src/test/ui/parser/trait-plusequal-splitting.rs b/src/test/ui/parser/trait-plusequal-splitting.rs index 9e2b5eb8735..c655a15d268 100644 --- a/src/test/ui/parser/trait-plusequal-splitting.rs +++ b/src/test/ui/parser/trait-plusequal-splitting.rs @@ -1,7 +1,6 @@ // Fixes issue where `+` in generics weren't parsed if they were part of a `+=`. // compile-pass -// compile-flags: -Z parse-only struct Whitespace { t: T } struct TokenSplit { t: T } diff --git a/src/test/ui/parser/trait-pub-assoc-const.rs b/src/test/ui/parser/trait-pub-assoc-const.rs index 5fce37a85ab..3ee2dc1ae18 100644 --- a/src/test/ui/parser/trait-pub-assoc-const.rs +++ b/src/test/ui/parser/trait-pub-assoc-const.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - trait Foo { pub const Foo: u32; //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found diff --git a/src/test/ui/parser/trait-pub-assoc-const.stderr b/src/test/ui/parser/trait-pub-assoc-const.stderr index 62778d7960a..8fc9ae4cf28 100644 --- a/src/test/ui/parser/trait-pub-assoc-const.stderr +++ b/src/test/ui/parser/trait-pub-assoc-const.stderr @@ -1,5 +1,5 @@ error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` - --> $DIR/trait-pub-assoc-const.rs:4:5 + --> $DIR/trait-pub-assoc-const.rs:2:5 | LL | trait Foo { | - expected one of 7 possible tokens here diff --git a/src/test/ui/parser/trait-pub-assoc-ty.rs b/src/test/ui/parser/trait-pub-assoc-ty.rs index 22e1ab4ef2e..042addfd1a4 100644 --- a/src/test/ui/parser/trait-pub-assoc-ty.rs +++ b/src/test/ui/parser/trait-pub-assoc-ty.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - trait Foo { pub type Foo; //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found diff --git a/src/test/ui/parser/trait-pub-assoc-ty.stderr b/src/test/ui/parser/trait-pub-assoc-ty.stderr index 42c26ec1717..b8eab4e87bf 100644 --- a/src/test/ui/parser/trait-pub-assoc-ty.stderr +++ b/src/test/ui/parser/trait-pub-assoc-ty.stderr @@ -1,5 +1,5 @@ error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` - --> $DIR/trait-pub-assoc-ty.rs:4:5 + --> $DIR/trait-pub-assoc-ty.rs:2:5 | LL | trait Foo { | - expected one of 7 possible tokens here diff --git a/src/test/ui/parser/trait-pub-method.rs b/src/test/ui/parser/trait-pub-method.rs index 5b40ae10993..9675182c156 100644 --- a/src/test/ui/parser/trait-pub-method.rs +++ b/src/test/ui/parser/trait-pub-method.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - trait Foo { pub fn foo(); //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found diff --git a/src/test/ui/parser/trait-pub-method.stderr b/src/test/ui/parser/trait-pub-method.stderr index 6ca4de8389a..d4db961c3fa 100644 --- a/src/test/ui/parser/trait-pub-method.stderr +++ b/src/test/ui/parser/trait-pub-method.stderr @@ -1,5 +1,5 @@ error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` - --> $DIR/trait-pub-method.rs:4:5 + --> $DIR/trait-pub-method.rs:2:5 | LL | trait Foo { | - expected one of 7 possible tokens here diff --git a/src/test/ui/parser/type-parameters-in-field-exprs.rs b/src/test/ui/parser/type-parameters-in-field-exprs.rs index 1c714c28662..1b8ed9f12b8 100644 --- a/src/test/ui/parser/type-parameters-in-field-exprs.rs +++ b/src/test/ui/parser/type-parameters-in-field-exprs.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error struct Foo { x: isize, diff --git a/src/test/ui/parser/unbalanced-doublequote.rs b/src/test/ui/parser/unbalanced-doublequote.rs index 56953aaf60b..f2131620537 100644 --- a/src/test/ui/parser/unbalanced-doublequote.rs +++ b/src/test/ui/parser/unbalanced-doublequote.rs @@ -1,6 +1,3 @@ -// compile-flags: -Z parse-only - - // error-pattern: unterminated double quote string diff --git a/src/test/ui/parser/unbalanced-doublequote.stderr b/src/test/ui/parser/unbalanced-doublequote.stderr index f2d9aa89ff1..4d98515c224 100644 --- a/src/test/ui/parser/unbalanced-doublequote.stderr +++ b/src/test/ui/parser/unbalanced-doublequote.stderr @@ -1,5 +1,5 @@ error: unterminated double quote string - --> $DIR/unbalanced-doublequote.rs:8:5 + --> $DIR/unbalanced-doublequote.rs:5:5 | LL | / " LL | | } diff --git a/src/test/ui/parser/unclosed-braces.rs b/src/test/ui/parser/unclosed-braces.rs index f3c8c180b89..9c9ab766130 100644 --- a/src/test/ui/parser/unclosed-braces.rs +++ b/src/test/ui/parser/unclosed-braces.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - struct S { x: [usize; 3], } diff --git a/src/test/ui/parser/unclosed-braces.stderr b/src/test/ui/parser/unclosed-braces.stderr index 92230005836..3ab366446d8 100644 --- a/src/test/ui/parser/unclosed-braces.stderr +++ b/src/test/ui/parser/unclosed-braces.stderr @@ -1,5 +1,5 @@ error: this file contains an un-closed delimiter - --> $DIR/unclosed-braces.rs:24:53 + --> $DIR/unclosed-braces.rs:22:53 | LL | fn main() { | - un-closed delimiter diff --git a/src/test/ui/parser/underscore-suffix-for-float.rs b/src/test/ui/parser/underscore-suffix-for-float.rs index be252dd5778..c9b7eced0b2 100644 --- a/src/test/ui/parser/underscore-suffix-for-float.rs +++ b/src/test/ui/parser/underscore-suffix-for-float.rs @@ -1,5 +1,4 @@ -// compile-flags: -Z parse-only - fn main() { let a = 42._; //~ ERROR expected identifier, found reserved identifier `_` + //~| ERROR `{integer}` is a primitive type and therefore doesn't have fields } diff --git a/src/test/ui/parser/underscore-suffix-for-float.stderr b/src/test/ui/parser/underscore-suffix-for-float.stderr index 5dec77bbeaf..58adcbbba76 100644 --- a/src/test/ui/parser/underscore-suffix-for-float.stderr +++ b/src/test/ui/parser/underscore-suffix-for-float.stderr @@ -1,8 +1,15 @@ error: expected identifier, found reserved identifier `_` - --> $DIR/underscore-suffix-for-float.rs:4:16 + --> $DIR/underscore-suffix-for-float.rs:2:16 | LL | let a = 42._; //~ ERROR expected identifier, found reserved identifier `_` | ^ expected identifier, found reserved identifier -error: aborting due to previous error +error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields + --> $DIR/underscore-suffix-for-float.rs:2:16 + | +LL | let a = 42._; //~ ERROR expected identifier, found reserved identifier `_` + | ^ +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0610`. diff --git a/src/test/ui/parser/underscore-suffix-for-string.rs b/src/test/ui/parser/underscore-suffix-for-string.rs index fd7e54fdb3a..bcd0b24c750 100644 --- a/src/test/ui/parser/underscore-suffix-for-string.rs +++ b/src/test/ui/parser/underscore-suffix-for-string.rs @@ -1,5 +1,4 @@ // compile-pass -// compile-flags: -Z parse-only fn main() { let _ = "Foo"_; diff --git a/src/test/ui/parser/underscore-suffix-for-string.stderr b/src/test/ui/parser/underscore-suffix-for-string.stderr index ed1b4d3ebd0..80d0d1bc83b 100644 --- a/src/test/ui/parser/underscore-suffix-for-string.stderr +++ b/src/test/ui/parser/underscore-suffix-for-string.stderr @@ -1,5 +1,5 @@ warning: underscore literal suffix is not allowed - --> $DIR/underscore-suffix-for-string.rs:5:18 + --> $DIR/underscore-suffix-for-string.rs:4:18 | LL | let _ = "Foo"_; | ^ diff --git a/src/test/ui/parser/underscore_static.rs b/src/test/ui/parser/underscore_static.rs index e1a9a02f9aa..21d6a1bc1b3 100644 --- a/src/test/ui/parser/underscore_static.rs +++ b/src/test/ui/parser/underscore_static.rs @@ -1,3 +1,3 @@ -// compile-flags: -Z parse-only - static _: () = (); //~ ERROR expected identifier, found reserved identifier `_` + +fn main() {} diff --git a/src/test/ui/parser/underscore_static.stderr b/src/test/ui/parser/underscore_static.stderr index 1b766f785a5..3bf3ce88a63 100644 --- a/src/test/ui/parser/underscore_static.stderr +++ b/src/test/ui/parser/underscore_static.stderr @@ -1,5 +1,5 @@ error: expected identifier, found reserved identifier `_` - --> $DIR/underscore_static.rs:3:8 + --> $DIR/underscore_static.rs:1:8 | LL | static _: () = (); //~ ERROR expected identifier, found reserved identifier `_` | ^ expected identifier, found reserved identifier diff --git a/src/test/ui/parser/unicode-chars.rs b/src/test/ui/parser/unicode-chars.rs index 8108ea7bd50..89ae85ec990 100644 --- a/src/test/ui/parser/unicode-chars.rs +++ b/src/test/ui/parser/unicode-chars.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn main() { let y = 0; //~^ ERROR unknown start of token: \u{37e} diff --git a/src/test/ui/parser/unicode-chars.stderr b/src/test/ui/parser/unicode-chars.stderr index 864866a12e8..3a360d8f468 100644 --- a/src/test/ui/parser/unicode-chars.stderr +++ b/src/test/ui/parser/unicode-chars.stderr @@ -1,5 +1,5 @@ error: unknown start of token: /u{37e} - --> $DIR/unicode-chars.rs:4:14 + --> $DIR/unicode-chars.rs:2:14 | LL | let y = 0; | ^ diff --git a/src/test/ui/parser/unsized.rs b/src/test/ui/parser/unsized.rs index 4d6aeb45cc9..e7fd7a1961e 100644 --- a/src/test/ui/parser/unsized.rs +++ b/src/test/ui/parser/unsized.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Test syntax checks for `type` keyword. struct S1 for type; diff --git a/src/test/ui/parser/unsized.stderr b/src/test/ui/parser/unsized.stderr index 51307435fab..3d4ed526b6a 100644 --- a/src/test/ui/parser/unsized.stderr +++ b/src/test/ui/parser/unsized.stderr @@ -1,5 +1,5 @@ error: expected `where`, `{`, `(`, or `;` after struct name, found keyword `for` - --> $DIR/unsized.rs:5:11 + --> $DIR/unsized.rs:3:11 | LL | struct S1 for type; | ^^^ expected `where`, `{`, `(`, or `;` after struct name diff --git a/src/test/ui/parser/unsized2.rs b/src/test/ui/parser/unsized2.rs index 5f566b97b3d..21370b329a3 100644 --- a/src/test/ui/parser/unsized2.rs +++ b/src/test/ui/parser/unsized2.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Test syntax checks for `type` keyword. fn f() {} diff --git a/src/test/ui/parser/unsized2.stderr b/src/test/ui/parser/unsized2.stderr index d607fad9bf3..fd12d86144c 100644 --- a/src/test/ui/parser/unsized2.stderr +++ b/src/test/ui/parser/unsized2.stderr @@ -1,5 +1,5 @@ error: expected expression, found keyword `type` - --> $DIR/unsized2.rs:8:7 + --> $DIR/unsized2.rs:6:7 | LL | f(); //~ ERROR expected expression, found keyword `type` | ^^^^ expected expression diff --git a/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.rs b/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.rs index f9302fef1aa..d322e9ffe68 100644 --- a/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.rs +++ b/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error use std::any:: as foo; //~ ERROR expected identifier, found keyword `as` //~^ ERROR: expected one of `::`, `;`, or `as`, found `foo` diff --git a/src/test/ui/parser/use-ends-with-mod-sep.rs b/src/test/ui/parser/use-ends-with-mod-sep.rs index 8606ca3c308..ad8da4d1860 100644 --- a/src/test/ui/parser/use-ends-with-mod-sep.rs +++ b/src/test/ui/parser/use-ends-with-mod-sep.rs @@ -1,3 +1 @@ -// compile-flags: -Z parse-only - use std::any::; //~ ERROR expected identifier, found `;` diff --git a/src/test/ui/parser/use-ends-with-mod-sep.stderr b/src/test/ui/parser/use-ends-with-mod-sep.stderr index 3ec45531d0a..4a2b95ada6d 100644 --- a/src/test/ui/parser/use-ends-with-mod-sep.stderr +++ b/src/test/ui/parser/use-ends-with-mod-sep.stderr @@ -1,5 +1,5 @@ error: expected identifier, found `;` - --> $DIR/use-ends-with-mod-sep.rs:3:15 + --> $DIR/use-ends-with-mod-sep.rs:1:15 | LL | use std::any::; //~ ERROR expected identifier, found `;` | ^ expected identifier diff --git a/src/test/ui/parser/variadic-ffi-3.rs b/src/test/ui/parser/variadic-ffi-3.rs index 678e95147c3..13bce27bb83 100644 --- a/src/test/ui/parser/variadic-ffi-3.rs +++ b/src/test/ui/parser/variadic-ffi-3.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn foo(x: isize, ...) { //~^ ERROR: only foreign functions are allowed to be variadic } diff --git a/src/test/ui/parser/variadic-ffi-3.stderr b/src/test/ui/parser/variadic-ffi-3.stderr index 5932a06778c..150de9e63d3 100644 --- a/src/test/ui/parser/variadic-ffi-3.stderr +++ b/src/test/ui/parser/variadic-ffi-3.stderr @@ -1,5 +1,5 @@ error: only foreign functions are allowed to be variadic - --> $DIR/variadic-ffi-3.rs:3:18 + --> $DIR/variadic-ffi-3.rs:1:18 | LL | fn foo(x: isize, ...) { | ^^^ diff --git a/src/test/ui/parser/variadic-ffi-4.rs b/src/test/ui/parser/variadic-ffi-4.rs index 5ff2ceadb07..812ed256a5d 100644 --- a/src/test/ui/parser/variadic-ffi-4.rs +++ b/src/test/ui/parser/variadic-ffi-4.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - extern "C" fn foo(x: isize, ...) { //~^ ERROR: only foreign functions are allowed to be variadic } diff --git a/src/test/ui/parser/variadic-ffi-4.stderr b/src/test/ui/parser/variadic-ffi-4.stderr index 4751cff4373..2d036b0cf37 100644 --- a/src/test/ui/parser/variadic-ffi-4.stderr +++ b/src/test/ui/parser/variadic-ffi-4.stderr @@ -1,5 +1,5 @@ error: only foreign functions are allowed to be variadic - --> $DIR/variadic-ffi-4.rs:3:29 + --> $DIR/variadic-ffi-4.rs:1:29 | LL | extern "C" fn foo(x: isize, ...) { | ^^^ diff --git a/src/test/ui/parser/virtual-structs.rs b/src/test/ui/parser/virtual-structs.rs index 522df6b5e66..ce57a3454bb 100644 --- a/src/test/ui/parser/virtual-structs.rs +++ b/src/test/ui/parser/virtual-structs.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Test diagnostics for the removed struct inheritance feature. virtual struct SuperStruct { diff --git a/src/test/ui/parser/virtual-structs.stderr b/src/test/ui/parser/virtual-structs.stderr index fc2736e3aa5..a5211d83f84 100644 --- a/src/test/ui/parser/virtual-structs.stderr +++ b/src/test/ui/parser/virtual-structs.stderr @@ -1,5 +1,5 @@ error: expected item, found reserved keyword `virtual` - --> $DIR/virtual-structs.rs:5:1 + --> $DIR/virtual-structs.rs:3:1 | LL | virtual struct SuperStruct { | ^^^^^^^ expected item diff --git a/src/test/ui/parser/where-clauses-no-bounds-or-predicates.rs b/src/test/ui/parser/where-clauses-no-bounds-or-predicates.rs index 6148c077210..45dacf22cfa 100644 --- a/src/test/ui/parser/where-clauses-no-bounds-or-predicates.rs +++ b/src/test/ui/parser/where-clauses-no-bounds-or-predicates.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z parse-only -Z continue-parse-after-error +// compile-flags: -Z continue-parse-after-error // Empty predicate list is OK fn equal1(_: &T, _: &T) -> bool where { diff --git a/src/test/ui/parser/where_with_bound.rs b/src/test/ui/parser/where_with_bound.rs index 2f0caec0376..3a1edb9ffc9 100644 --- a/src/test/ui/parser/where_with_bound.rs +++ b/src/test/ui/parser/where_with_bound.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - fn foo() where ::Item: ToString, T: Iterator { } //~^ ERROR generic parameters on `where` clauses are reserved for future use diff --git a/src/test/ui/parser/where_with_bound.stderr b/src/test/ui/parser/where_with_bound.stderr index c8d3cede406..e68f7445558 100644 --- a/src/test/ui/parser/where_with_bound.stderr +++ b/src/test/ui/parser/where_with_bound.stderr @@ -1,5 +1,5 @@ error: generic parameters on `where` clauses are reserved for future use - --> $DIR/where_with_bound.rs:3:19 + --> $DIR/where_with_bound.rs:1:19 | LL | fn foo() where ::Item: ToString, T: Iterator { } | ^^^ diff --git a/src/test/ui/parser/wrong-escape-of-curly-braces.rs b/src/test/ui/parser/wrong-escape-of-curly-braces.rs index af5e5e8dfcd..7a5c27afca5 100644 --- a/src/test/ui/parser/wrong-escape-of-curly-braces.rs +++ b/src/test/ui/parser/wrong-escape-of-curly-braces.rs @@ -1,6 +1,4 @@ -// compile-flags: -Z parse-only - -fn f() { +fn main() { let ok = "{{everything fine}}"; let bad = "\{it is wrong\}"; //~^ ERROR unknown character escape: { diff --git a/src/test/ui/parser/wrong-escape-of-curly-braces.stderr b/src/test/ui/parser/wrong-escape-of-curly-braces.stderr index a9b276fc814..90debfc337d 100644 --- a/src/test/ui/parser/wrong-escape-of-curly-braces.stderr +++ b/src/test/ui/parser/wrong-escape-of-curly-braces.stderr @@ -1,23 +1,23 @@ error: unknown character escape: { - --> $DIR/wrong-escape-of-curly-braces.rs:5:17 + --> $DIR/wrong-escape-of-curly-braces.rs:3:17 | LL | let bad = "/{it is wrong/}"; | ^ | help: if used in a formatting string, curly braces are escaped with `{{` and `}}` - --> $DIR/wrong-escape-of-curly-braces.rs:5:17 + --> $DIR/wrong-escape-of-curly-braces.rs:3:17 | LL | let bad = "/{it is wrong/}"; | ^ error: unknown character escape: } - --> $DIR/wrong-escape-of-curly-braces.rs:5:30 + --> $DIR/wrong-escape-of-curly-braces.rs:3:30 | LL | let bad = "/{it is wrong/}"; | ^ | help: if used in a formatting string, curly braces are escaped with `{{` and `}}` - --> $DIR/wrong-escape-of-curly-braces.rs:5:30 + --> $DIR/wrong-escape-of-curly-braces.rs:3:30 | LL | let bad = "/{it is wrong/}"; | ^ diff --git a/src/test/ui/rfc1598-generic-associated-types/parse/in-trait-impl.rs b/src/test/ui/rfc1598-generic-associated-types/parse/in-trait-impl.rs index 58353052b41..589e5fcc00e 100644 --- a/src/test/ui/rfc1598-generic-associated-types/parse/in-trait-impl.rs +++ b/src/test/ui/rfc1598-generic-associated-types/parse/in-trait-impl.rs @@ -1,5 +1,5 @@ -// compile-flags: -Z parse-only // compile-pass +// compile-flags: -Z parse-only #![feature(generic_associated_types)] diff --git a/src/test/ui/rfc1598-generic-associated-types/parse/in-trait.rs b/src/test/ui/rfc1598-generic-associated-types/parse/in-trait.rs index e2954638139..7fa71e4dd1a 100644 --- a/src/test/ui/rfc1598-generic-associated-types/parse/in-trait.rs +++ b/src/test/ui/rfc1598-generic-associated-types/parse/in-trait.rs @@ -1,5 +1,5 @@ -// compile-flags: -Z parse-only // compile-pass +// compile-flags: -Z parse-only #![feature(generic_associated_types)] diff --git a/src/test/ui/structs/struct-duplicate-comma.rs b/src/test/ui/structs/struct-duplicate-comma.rs index 2d4551c55ed..ff0d58abc3a 100644 --- a/src/test/ui/structs/struct-duplicate-comma.rs +++ b/src/test/ui/structs/struct-duplicate-comma.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Issue #50974 struct Foo { @@ -14,4 +12,3 @@ fn main() { b: 42 }; } - diff --git a/src/test/ui/structs/struct-duplicate-comma.stderr b/src/test/ui/structs/struct-duplicate-comma.stderr index 112ea905025..2297fea6353 100644 --- a/src/test/ui/structs/struct-duplicate-comma.stderr +++ b/src/test/ui/structs/struct-duplicate-comma.stderr @@ -1,5 +1,5 @@ error: expected identifier, found `,` - --> $DIR/struct-duplicate-comma.rs:12:14 + --> $DIR/struct-duplicate-comma.rs:10:14 | LL | let bar = Foo { | --- while parsing this struct diff --git a/src/test/ui/structs/struct-field-init-syntax.rs b/src/test/ui/structs/struct-field-init-syntax.rs index 31463992aca..161f7e93af8 100644 --- a/src/test/ui/structs/struct-field-init-syntax.rs +++ b/src/test/ui/structs/struct-field-init-syntax.rs @@ -1,7 +1,10 @@ -// compile-flags: -Z parse-only - // issue #41834 +#[derive(Default)] +struct Foo { + one: u8, +} + fn main() { let foo = Foo { one: 111, diff --git a/src/test/ui/structs/struct-field-init-syntax.stderr b/src/test/ui/structs/struct-field-init-syntax.stderr index cd8f6b975b6..0b72c5cf734 100644 --- a/src/test/ui/structs/struct-field-init-syntax.stderr +++ b/src/test/ui/structs/struct-field-init-syntax.stderr @@ -1,5 +1,5 @@ error: cannot use a comma after the base struct - --> $DIR/struct-field-init-syntax.rs:8:9 + --> $DIR/struct-field-init-syntax.rs:11:9 | LL | ..Foo::default(), | ^^^^^^^^^^^^^^^^- help: remove this comma @@ -7,7 +7,7 @@ LL | ..Foo::default(), = note: the base struct must always be the last field error: cannot use a comma after the base struct - --> $DIR/struct-field-init-syntax.rs:13:9 + --> $DIR/struct-field-init-syntax.rs:16:9 | LL | ..Foo::default(), | ^^^^^^^^^^^^^^^^- help: remove this comma diff --git a/src/test/ui/structs/struct-missing-comma.rs b/src/test/ui/structs/struct-missing-comma.rs index e07080f609f..4c3cac33691 100644 --- a/src/test/ui/structs/struct-missing-comma.rs +++ b/src/test/ui/structs/struct-missing-comma.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z parse-only - // Issue #50636 struct S { diff --git a/src/test/ui/structs/struct-missing-comma.stderr b/src/test/ui/structs/struct-missing-comma.stderr index a941c5bf1ab..00ef1a7ff92 100644 --- a/src/test/ui/structs/struct-missing-comma.stderr +++ b/src/test/ui/structs/struct-missing-comma.stderr @@ -1,5 +1,5 @@ error: expected `,`, or `}`, found `bar` - --> $DIR/struct-missing-comma.rs:6:13 + --> $DIR/struct-missing-comma.rs:4:13 | LL | foo: u32 //~ expected `,`, or `}`, found `bar` | ^ help: try adding a comma: `,` diff --git a/src/test/ui/tuple/tuple-float-index.fixed b/src/test/ui/tuple/tuple-float-index.fixed index c93b545afb9..cd1a85a9d24 100644 --- a/src/test/ui/tuple/tuple-float-index.fixed +++ b/src/test/ui/tuple/tuple-float-index.fixed @@ -1,5 +1,4 @@ // run-rustfix -// compile-flags: -Z parse-only fn main () { ((1, (2, 3)).1).1; //~ ERROR unexpected token: `1.1` diff --git a/src/test/ui/tuple/tuple-float-index.rs b/src/test/ui/tuple/tuple-float-index.rs index 9b669bc4bb8..1faabac2bcd 100644 --- a/src/test/ui/tuple/tuple-float-index.rs +++ b/src/test/ui/tuple/tuple-float-index.rs @@ -1,5 +1,4 @@ // run-rustfix -// compile-flags: -Z parse-only fn main () { (1, (2, 3)).1.1; //~ ERROR unexpected token: `1.1` diff --git a/src/test/ui/tuple/tuple-float-index.stderr b/src/test/ui/tuple/tuple-float-index.stderr index 5bbccba39d8..9a3e384b9d1 100644 --- a/src/test/ui/tuple/tuple-float-index.stderr +++ b/src/test/ui/tuple/tuple-float-index.stderr @@ -1,5 +1,5 @@ error: unexpected token: `1.1` - --> $DIR/tuple-float-index.rs:5:17 + --> $DIR/tuple-float-index.rs:4:17 | LL | (1, (2, 3)).1.1; //~ ERROR unexpected token: `1.1` | ------------^^^