diff --git a/src/etc/generate-keyword-tests.py b/src/etc/generate-keyword-tests.py index 99d11c8178a36..9936ce71b76bc 100755 --- a/src/etc/generate-keyword-tests.py +++ b/src/etc/generate-keyword-tests.py @@ -16,8 +16,6 @@ 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 8362c86f8bab9..cca2702f1a784 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 abb07962e894a..358a27d387820 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 f3280e87a01c2..72612252a8098 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 b7365cd16e94b..ef203ef082b22 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 3e094733220da..1720ca420ca29 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 064990e52b96c..80990b2bfdef0 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 a91483aca4a17..339da7f8a020c 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 a644f6239b368..f1b028ea8de02 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 7dc3e7237abb2..5914805e5c1c8 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 fe4641b2004b1..3d35aad745589 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 aa225be245469..ed9c996d4ccef 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 b7488d3085a83..cefd3369742be 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 1c1c2762e47bd..ddc7a4b034b7f 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 c72e9c3fb5184..b51e9f2212dda 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 a31300cd8a028..863a2d2069fce 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 28d5cea05abe2..7fe5427249141 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 f29c14ab353d9..7351702ec9dce 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 c090a77fc30a5..6af1783e630fc 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 79bf4c0695f9d..c7c45bafb0d1e 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 2fe6c7090d517..71488d2e5c369 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 ffc6bbc835b55..261ed3913afd7 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 5f09b05eb7f09..d896b61ce49c4 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 9f4ee80285a53..041f30cd24272 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 e66dd7fcd943a..44714dc56eef3 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 2078320f12874..4bdd16471cd80 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 7be8f7200a88c..067c4192ce6af 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 085f61645fb92..1c9b5973be7fe 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 989d63e2e949d..391e7f0acf979 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 32c4beec0e428..79bc7eec3113e 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 02f7dd6716481..dd3a2d2a27a0a 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 3f3e7533ae25d..9b42716924d32 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 847fdabaaf096..15e61cf06cae9 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 7f446542ee016..0e5a01103dc5f 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 43b01800d6b35..860f9f96bb8f5 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 3379ab8bf1560..4645ab4a77549 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 1a5c982a43dbc..69a496f3a0c39 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 40815abc12f89..0f64266d322d5 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 f431706ccd76b..2606b7450aef9 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 0a6dca75888b2..16b61caa4dffc 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 8751a0a24269b..3495353c6f905 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 945823fdddc7e..c1de0df54e278 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 ab83744013d49..618e577e4e229 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 0352dc0f6fe08..64d702d14bb78 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 b2c04c73e09d1..e30b32f41b413 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 1e64756a6de70..e458f644c9f47 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 8fe3bdc407e0e..33bba35f692dd 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 6d865ffeb2427..f184107bbd1c8 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 c287dc4b47ba4..a8a22aaafce33 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 d0c7c9df26c5b..f1a002a9f7b60 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 6f8373f2d277e..0300fe9891016 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 532bf53d61fc5..acb04e7859b2e 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 4b3dea18d5549..6a8d7e9d4a165 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 52b4556084fef..89a969bb2e2a9 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 e78d3990b5036..f39e5beb6ac90 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 e855231969bb5..cc86879bf461a 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 fa10de3015533..2520ecb294c9a 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 c29f3caa4c4be..459d5c3b6ea4f 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 1e7d519722834..f41520861627a 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 0afaf873ae280..4c49e3122c702 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 59dc5ef413930..bd358af29843a 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 82ab311bb5932..d028f28655b8e 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 06757fb4f9e94..6968ca97b8219 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 bd5c438d9bed6..b85003bf0910f 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 0d54e2aa1d630..7751a8c0f38a1 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 10ee1a9afd858..f2f85d0265a8a 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 973f87af114b9..45583466adc2c 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 ae675109b249c..54eb791d2bce4 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 884c213c5b4e9..dd7ebffd50672 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 abd5e5a367859..e158e5247db18 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 992e1f12ff24a..b12b47b67ce10 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 fc092ebbc987d..17cd06864bf1d 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 ff87706b2d2b8..27193672903ac 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 7ab78dc49d74d..61fae721ffbde 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 085cb9dac17ad..6d13b0f1cc872 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 8a1904f228acc..7870555aebb23 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 73c644682c70e..c4125a09fd2fd 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 4cf74001436e9..b31836e95e880 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 ec89316232397..695d4da1dca60 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 e73fc0551cd98..47fab7b40f4cd 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 68a5dd3cfe566..d33520baebe07 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 7dc472d915f2e..d9777be63d280 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 9ce6f99a76449..4e0b65ef496db 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 d24f711397b6e..8ff946344aee8 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 2c6c93e469a24..55719cf641195 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 2d5d549d4c329..405a7e1e2a33b 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 f1960ae7ac38c..e6bade18d0a2d 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 b67fc28885bf3..e7055f6a5fcb4 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 e0e98681a95e0..d5c2a314cbbf8 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 0c08af61fa849..bb17e97e950c6 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 7b16cddf30528..880b536cd18c5 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 57fad0e93125f..207ebef642bfa 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 770eab3f46ad6..965a8a45aedea 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 c383de6f6c1a2..58b2fa1afdf31 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 b45920aa6399c..ed888eb1a8ea8 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 137133299d87a..dd46b87fa426f 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 4bd95dbeee30f..94b2d1d7b7e86 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 d770b6687c9fd..a5da77dc76361 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 32b26670ea850..d2fe8b77ce668 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 2836ec7d160c9..c37ddd69ce53c 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 5a3618cc0b9e4..e764cd0840196 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 70088631db66d..212378c28665b 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 d741c70e58028..2938bba77d717 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 4bfdb241dfd83..c2a80e8fa1594 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 e3fee987ab701..3fce08259fca8 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 0afc17877f7e8..5842037fb8050 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 498bbd6b0ffdf..27425a3c99a35 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 6afdc247c3a73..a966e9937373a 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 5a3a581fca4f4..de4c07aa7bb6f 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 a8426b7351cfd..ebca2db8305c3 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 f96f48d5fd695..b9b753dcd70a8 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 475c8d7b972cc..2853873278251 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 1c72ed091af73..36f4191f06bc3 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 8ce82b5238a08..0dde49a2913f1 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 07bcf0780f6e8..1b405e20e0384 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 bce0b74e0688e..001eab226dc21 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 0de71396640da..206242c3c7fa6 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 26e115ef1a29a..d7774c333c29a 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 c0d9523db161c..42430278c7267 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 f733424e57bc7..bdb8faa6c6593 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 63d3f4c5b1b65..3b5e3199a8ab3 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 9c04ba37e98cc..47e1f7adf25ec 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 41f6e34267630..dd84af393003c 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 e8af009196845..9c9858aa26cb4 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 0bb55cc9a7219..e495c0411d816 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 233f37c5c7dec..894139f24ddaf 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 de3208e52347c..a02fd41b349c2 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 d6a8b525f3594..9b3115cb3f4b7 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 c111959f50bbe..a6106159805b2 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 f69129573d644..a31429e7228c5 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 1ad15f9064da2..221bd311e7479 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 4fe3856768c64..4582aeef428d3 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 3642b80a01b2d..f5894349e1576 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 cde084784bb70..1cc82f523c4ba 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 64301530fb354..4dc2c66601807 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 f4ea550acb5cf..a1953396153e0 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 0f0641e55dfea..f61cb6b8dd6eb 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 155fa465f4f32..3de8a169c6922 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 d9d585990882b..0bd10b4d08516 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 3d8c74c76571d..668b8d1de6899 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 fb4c01ac71cf3..f253de92d92de 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 4f6b18d93f7e0..11ce0c44351ad 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 c82e2b6eb0bbc..4a5606af6d025 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 0c70a7f0a5c3e..3a886c4c481f1 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 44000211a0aa5..ba874fb4476f0 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 96f3b03dc9240..c91595208c864 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 2be809bf2566b..3d0bf3c1c7b9f 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 8a8e100a890cd..3f656b63cdb84 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 bbe3a9b8dac04..9c00289287cde 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 808e3999e05e2..b225e11066dbc 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 f9b8d3104d9d5..4e74516d6b6fb 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 d54a57066b1e3..29a65ebe41889 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 487abd30ebf8a..d3f32255c31d7 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 2fe897e46cc5b..6112623041a7d 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 207298c363cfc..050e9a258d1ed 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 b7d003df56b71..5cd6a4f7c6860 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 28094ed4bea6f..796db66d22e9a 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 e57871ae6887b..c6c04279666a0 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 8b682732f6474..edc69e6f49f4d 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 922cfe07ac0dd..f92604d0067c3 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 d31d31c8e124a..822f4a6fde2c7 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 b9eabf0e3c08d..627b74ff8f7bd 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 e9f26cb39169c..49b8de03c3747 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 a677a7ea74be8..e06eb7a9846e1 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 545984706a214..8d8401da61a85 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 da925b590a8db..6cf39608fcc9b 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 13a5cc320e50f..46cd45f28b43d 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 ae8b106f6a28b..1e0244c2e1d32 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 3b9bad2d1bf60..25cd7ffce5a97 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 e8ae163314a3e..8935ea9c6c125 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 a34b2b5fea96f..b03d578e3d638 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 b668e4999de1d..3a4fa9a5e7ba7 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 50e166c1f36f4..7e4e24fae1964 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 6ca5ff7344af6..da25aac486e35 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 19308e115e345..565f84822f7d6 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 a41696884a372..0f4cd5724ce1e 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 f8a2f1cc7e6c9..b4b8f1fc0b0ab 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 a5c2c0c43396e..005ff9fa2e0ec 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 0f684ca508c5c..4e073d8c58aaa 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 f8b5a64bb6f69..1d128d33e4f49 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 5a0244bb50146..f773a7df4fedd 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 58500ffe3dc1c..799cdd8022257 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 b3e1a96a21845..469c034795efe 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 08674c7b9ae18..c0ff331b8bae0 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 2ad0bbfb1777e..6d09d82e34f33 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 5a44b3f712df4..38e30de716d0a 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 6d4638836b1da..489451bb5dc8d 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 66f4b5f097fc6..00b241b9054cd 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 41905b0ec4dea..eadf5546d8505 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 2ca169949f808..7e55bc038e766 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 96677be832322..a01517d016d07 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 264ea351997b7..53e519a72a5fd 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 931bef3b0bb97..07eafdde9071a 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 40ed0285d2061..9c01a5c6d20e3 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 f03be3d7112f8..d74c539abfe54 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 94fe70ddd8f56..49e7a2f536f2a 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 72c75ce8ff52d..3a612f95c036d 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 11cdf620e950f..c2491df903b76 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 a25c7d262e312..2ec86958174a4 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 162bd8e43b66d..6dff63f5cf412 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 70d48f853131e..38d00a0ea0b4c 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 2f6202e07a1c5..3c24d2b447de4 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 c34f55ec59bfd..baf8bafb8b717 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 f92f6a1534a3f..780f63a663860 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 72cc2227eb8a1..303b902c49904 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 cd52da8a45c42..bc48853b380e6 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 9c87b61a78a4c..fa40f15dedb5c 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 835887f5520c4..3f15c0c0d755c 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 298247e2e7f5c..b694642a9c5d6 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 5c67bbaa62cf9..f9f00f70f0b90 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 d2e4d3861fb65..2dfa08fe82d62 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 5814e8037e981..b4760161a62a5 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 387cf99397045..9d0cbce6c8a37 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 7b3d3b2b7c506..4442cd0ff011c 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 14f92eeb08e68..890802ac134a0 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 3f94b31bd711e..4185ae034b504 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 d2a38a41aa655..23ff259db3048 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 c14dfc48df4c9..6eaf5e2ed93ee 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 acbd4a8c92ca0..33961bb308467 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 5e1ad39c16005..07a134442b8de 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 02affe09c6b56..5ee111d38c9c3 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 6e17e34df8896..69af97374455a 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 cd86858716ed9..48fc142cf64b1 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 c3a42382aa531..c727f1754c77e 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 58683a3d0065b..06315a48349ff 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 d26e524c153cc..7fd2761884f79 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 61e64c7e14897..0c69105cf9457 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 cdb8cb7d3d7d6..6d180bb56da5d 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 2fb1a6d341c4e..d1675800a2791 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 3c247f7f6d231..dc7e37824dc68 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 7350f5a7f3e06..e1cecd0e8e07a 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 ab85d73275d8a..897624279e5e8 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 dfeb444ccfdf5..bca2d5996a54b 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 c1297ca31d365..945fc77c3102f 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 806156f26a3ee..ce49fd90d9101 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 ae081dc4cecc1..32263e9f6e20e 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 d71b77f7203b1..a1302970689c4 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 7eaab1230b4b2..11ba41015cbd2 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 a151b089e6643..95a34483ad21a 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 97442a228e7a7..960a42df429e9 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 4cd0d88cf9f59..e4499dea255e3 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 c776aa499da32..2300a257a02b5 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 690a6bd700d4a..07c0ddf8ce573 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 1c05bb864b83a..ed2c8a4eb9c4c 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 9be7373cf1172..8643ffe434505 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 9168fbb515142..f91cab029533c 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 02a0d754c6e35..8ef6b6810a56b 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 5a3cc7f904d1d..4c8e76695bc8f 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 1f9ffc82da4d4..96bcdccf0a096 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 89b7319320882..8aeebcebec959 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 7b7e3508dcaf6..2193af530bd7a 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 daabaced67afd..37e06708e25fd 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 41b86b0229fdd..9b919d2b383c2 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 c3a4525032cb6..b0266060903ca 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 423fbaf2a226f..948a20095f1ea 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 03e6b39990001..69a6415908c2c 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 6e5d84c5b0ce1..2ed8cc6b268ca 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 9353914d24723..8b595673ec4cd 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 fc2a98af515e9..f5e04b5db7346 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 f5805bfbff91a..656df196f09b1 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 e85e818e92581..920931b00f954 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 f6596326e6b40..903137542d6f8 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 ae55d30ee4bc4..3ccbfccfc9394 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 23f4325d8b10a..4830e6f1bef40 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 593db01ba830e..69d8f19065533 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 a700116cc87e3..50ac690e425ad 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 c53cf2f84f927..f62858442d252 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 d96b465096fcc..3736f366cbd49 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 a2782d42cf3ba..13a938b2e0988 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 1639558431450..992547e6f59c0 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 13ffbec81b74f..f7db20034a10d 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 667caf1856319..4ef102646ef1c 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 feedd63fde86a..07c9f883b60fb 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 d3530a3bfb493..adb20ebe48c79 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 b7c0cfd83b73b..ddd5e4d7b115f 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 08c69e491246f..198444bafc5b8 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 a2896ca7f33dd..7e798a3f0b9d9 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 8283cf5c31cac..5624a8fc46038 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 3807084146d7f..5285520cc20c4 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 7c70087a441d3..c0a539d350764 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 eac17debf81a0..b84a652dc5c81 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 92c05e53b6002..1eb7886c5a53a 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 1c729ff083352..262467b690720 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 cdcfa74e07268..5c7049f7c9bc7 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 b4b76470de1c1..4c4d5e5dd001e 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 316e7398a4a1a..da36537f0f307 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 6620c9b680571..54d75ed682d0d 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 0579302d5f2f4..7f859995218d9 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 99c7147f1e472..a7075b7187812 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 0ea8290ad9383..f8749708f7721 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 7b962528b3cce..89f18e3e2aa4d 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 8ac2d905ef9cf..966e2bb949688 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 7ad4001a45532..550cb5449df19 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 3c7bcf08718e1..247289ea4d54b 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 59acc48aaaf79..523d71ff49d2b 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 f478c15b33dc7..9496ad305fc2c 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 70f1aa41919eb..f4cc2c5c420fa 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 6bcc13815a4df..feb670c3d3dd0 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 7476bf3736a5f..284ffde9efbe7 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 21fbfe715e8bd..b588b007ae929 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 d6cccfa6c718b..90d359231a6e7 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 0fd05d78f988f..40e0cc1d786d1 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 1535cfe299640..afee685cd056f 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 782b6c1d2fdd3..e525c7b6d680f 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 ede3eaeb37bcc..1f147216ea62e 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 acc5e92ff1488..71ed8200e9a5d 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 56eb976b9c67c..987c955d1dc38 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 c6d1382f7f38d..59762e021652c 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 cb1898e6ea733..58489fb2c511f 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 d3edb04c11951..4a10dd50b2340 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 29fdd9efdf2a2..3f3e997deceb8 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 38e5393b04a1c..1185f882a1390 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 c25e5fef1a711..805ba8b6baa60 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 2c3284b6d2dd8..a727cafcab023 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 efdca38cdea06..84dd302b4a8e1 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 0ad5b8d3f81f3..fd79fa8df7a68 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 01ca2a6ff070d..4f9e7fb5de85a 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 1a79da38c3d18..1a40d67492990 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 4ba87efbed7ed..2782af49e66b1 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 ac7fe5fc1ca0c..09ebb2e1d8370 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 f6fcefe83e5db..692b116123a60 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 9c8fb1eff4907..e5e85ba8ca602 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 7168f0b8d55ce..5a5fc9c450989 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 a6c1028ce134c..e662c707a38b9 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 3e06a5ddd2746..f7f0e2d2d1168 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 c7ffe7bd0fd64..0cd9e9c799f1d 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 0f8b9c06e7fea..67abd6304d515 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 6f355ae028bb9..9450d89e5f51c 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 22bd81196d5d7..a3a3486dd9e36 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 e528819b39b25..d4735e8a7381d 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 500b3423ff1ed..c9404d8b9e4d3 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 2c6275699b479..f9b4b37acc0dd 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 c9400c0153d41..61dbc82384873 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 9c4384c5385ee..a5eb48252394f 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 09a21d894b905..5bbb4ce569f0b 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 cf75cdaa98a16..0e1421214d9d8 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 77a7980e893c3..828e72e56eac8 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 228518f8c1a1d..b30b3dbf9036a 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 4f5bef1802f31..97ba3fb2cb666 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 8a38e1407ac0a..295ab08c00250 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 158b3a19f016d..038002ae05e56 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 49a35663a912f..b871000ac1284 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 c3ed2ac2dcf34..c078bf5f63ef9 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 c3eab544d7aa5..7ff3e28ccb688 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 4e56cc2d323ff..d830c96fc2f98 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 7d9aa057ba090..1668cfe5a33ed 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 c74fc8c25dcbd..57201f2d91afd 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 8efd28b5977d0..e6a02d5fc5642 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 db6e06979147e..46d6038e80207 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 a9c0e9133b78e..5ee9daf464055 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 0e3717f861a96..b21a1bd08315c 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 9ae57223c86c4..cb151d652e133 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 dfab02ea5e0e9..6423aa2dc2fd1 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 dec0ba820b92b..68b1c2baf1001 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 bee68651782ad..79460e01f257b 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 5ef43ab017888..2e2001434f28c 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 a420931a703c0..1bf27161513fe 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 3459c73910929..6eb01c1c93337 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 d235767dcb498..cce1a17e9e8df 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 349ea9bec49ef..a8bdfd3fa181b 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 9c0448f559af7..536d14e1b6507 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 96084229998e4..de314f6c6412d 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 85f5bb9bc3c9f..18e0e9e8f0c45 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 f5253ad405e36..c4b9dd469f54c 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 3dcace5e06a01..7e76a04ce6f5d 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 d4639b390c1cd..9bad0cb25c1e4 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 ea17dc47cc81e..bf5b61907614c 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 69b97e7cc5b64..36c0d7733733a 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 c04a7a23f907d..44394c3002157 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 1c8b04bc1fe32..ce953b2eb2299 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 1106cafd9d0b3..378caf6300057 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 858d22ab79fa0..9f736ed328c5c 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 fd92c31360ef1..ef8b4f94ef49d 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 407483fd01963..65da55e3bda8c 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 5f1eacc663fe6..f923228710bf3 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 5cc869c99d9a0..7f4a5f3239e76 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 62dea7939a193..0a1d7a1f6b8ab 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 85bb6bae9cf25..412dd141de0ee 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 545b9494100e4..8729e8c5854f7 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 8dad6e258e44f..213fbe371d435 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 a867a3ee07470..33c69deda42ca 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 b52ecdf0a3237..108278fa58e94 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 4bf495adf4ec4..ec12336356619 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 1562447533db3..63dcde45bfb5e 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 c015341209c5a..90940eb1723b8 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 70584952b3e9b..76f60d94bc86e 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 665254c7ce6b3..fe4b4deaa60d9 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 6bd5775945279..03176abaf49a8 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 7d12e19768af2..2ca10f697604d 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 9eb64cd23d197..f04af1a0d65ff 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 354f04cc2a650..2b4920a792f09 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 4e9c3e1e925a0..931839fb282d1 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 9f893ac84d2a3..92c33487ee4be 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 db6ae7003f88b..20af956720579 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 20915e49c0174..90ec46165e733 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 1460010ec3fa5..bc61c5b49ea87 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 0a0b9e53e5b24..f50b2fa49fb0c 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 4f1572779ad04..a780304c2d51e 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 b30fe2e1faea5..b74907b72b0cf 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 9e4595036b206..071cd6241da20 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 4d3f2528d6849..2800e4090cf79 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 a2f6b8c8f1074..2f13893cecd2f 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 be165f415445a..47fd331969dfe 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 c38855cf35e74..5a1d1be11b633 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 c3e0386a9fb9b..6dedcfb6a0aab 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 ef35aa47094f9..fd317295561f4 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 f3d4d60df1010..67792eb91e5ca 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 896cfa0cc007d..f51e565c2d338 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 b73a7e4ddd97b..8465b6a6e8495 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 e033e4857ad85..d7b9553d032d3 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 e5aee80142bee..e64332785cc51 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 d4d6bc4a2d1f8..bbedd395202cf 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 067bfbc803362..9427b33afd8d4 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 a85de0af55123..84f07c4a941bc 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 1bc8c177ec85e..5572511881d57 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 a12da5b0d6543..204ad85716564 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 b96e427b16cba..65a187737879d 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 f27320f402305..500591b2ad138 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 67084e03737c7..2cc9b1ac45c7d 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 385eac0eea2f4..026d14ca41392 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 50fde58a35746..ceac94080062d 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 1ad4a48a58ab8..f52988cdb20e6 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 d8eb6c4b44095..518f90b2b8368 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 2d9b3df5dd29b..4c710dec5ba3d 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 c3dbd39abf3c4..71c22e62f8e4b 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 9d8fefa5fecf2..2bccbd91452f6 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 70110bd5529f1..3412788668ac2 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 2ca6fbd48fb9a..ac28e21ae0329 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 f859ec6337bda..fbefeb26a501f 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 5f70c435ba26c..560efecb91cfc 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 8cbed9ef924bc..318591e5cc0a4 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 77735f4fab47f..725843429c003 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 db5b634b3907d..9303a67a8cc7b 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 ace8dc42ab160..23851b5f70b37 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 807b47b0c0d3e..5e7139d6bfd85 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 f68a1bcf17167..2ee95db5a25c2 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 3995b6e3f0f62..8164645b01b7f 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 b492a86c9acfa..923a7ea37a409 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 513d896d2a298..f0eafa3d00a6f 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 3457b96f36f4d..5b551addbc893 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 5b61315add16a..689ed35668ec9 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 b16a741bee160..d1d91c8f7dcd3 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 13dfc3dcfa183..f9b98596ae399 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 3cb1cd4f6b37c..df3964196b8a2 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 ab42e0bbc4657..84e0432c48c0c 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 95166bd3875eb..08ef4b4326934 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 8b2dbb3267bea..90d0764def0bc 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 7d9b8af734c07..12de76d9d6d9f 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 dc1608240621b..0177b19d74e7e 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 a08baf622d4ee..57cbe8d5be655 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 6a69cdf8e8f12..77ed4fcea517c 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 22b9ba2a41d10..11db391c5489a 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 ade56efcc89f3..5642d2f45ffce 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 912da96f2da06..525be5d20e27f 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 ca33ed986b01d..4597b14321513 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 a6ed6fc69e6a5..914588f51e1e3 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 29fc654c97182..f5dc226934ec6 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 0dec3d375c3ed..526b5e75c4574 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 3117fdcc14899..38a5e22e3f7b6 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 f69b9b1cbccb4..362a71c577fc9 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 55018a8072de9..49b9a52aff918 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 d14276fbf782b..35a1109035146 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 680258b1d0437..64ddde0e9e97f 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 cd3e640b67ceb..561cdcea089a5 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 4de05f0ebde95..9a6ab81e7c02f 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 743b7733a2285..e5049082ab016 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 0968009057f8c..2303df93810cd 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 55ab871dd333f..35a36cbbf91c6 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 6bb393a1910e3..aa45ea4ac26e9 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 cbc919516c18e..8abf2624e4f97 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 d019bc7d3e437..972e4296da358 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 1204f05e9f118..153f942b978a8 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 f89dbb0ed8fb1..d77ff80ca2597 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 4d732b3a7c84b..0f1f49a521bd6 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 e9f1dc5791981..74e484eebee1f 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 +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 `(Copy + Copy)` - --> $DIR/trait-object-bad-parens.rs:6:16 +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<(Copy + Copy) + Copy>; +LL | let _: Box<(Auto + Auto) + Auto>; | ^^^^^^^^^^^^^^^^^^^^ expected a path -error[E0178]: expected a path on the left-hand side of `+`, not `(Copy)` - --> $DIR/trait-object-bad-parens.rs:8:16 +error[E0178]: expected a path on the left-hand side of `+`, not `(Auto)` + --> $DIR/trait-object-bad-parens.rs:12: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)` - --> $DIR/trait-object-bad-parens.rs:10:16 +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 Copy) + Copy>; +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 fef8352e93bef..b188e14778be5 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 e5a201a7abd29..a9b542ddcc4d3 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 e08c3bc3ac58c..40d2ad52c3574 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 a6add6079cece..5e2a35ea60cb0 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 3802d35aa1dc3..2bbc5800015bd 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 0000000000000..36494b765394c --- /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 9e2b5eb8735af..c655a15d268c1 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 5fce37a85abe7..3ee2dc1ae18fb 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 62778d7960a80..8fc9ae4cf28b4 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 22e1ab4ef2ebf..042addfd1a434 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 42c26ec17173e..b8eab4e87bf0b 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 5b40ae1099353..9675182c1561e 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 6ca4de8389ada..d4db961c3fa9c 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 1c714c28662c8..1b8ed9f12b880 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 56953aaf60b10..f213162053780 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 f2d9aa89ff188..4d98515c224ad 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 f3c8c180b8914..9c9ab766130cf 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 92230005836b1..3ab366446d86e 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 be252dd577851..c9b7eced0b2a0 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 5dec77bbeaf38..58adcbbba76ba 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 fd7e54fdb3aef..bcd0b24c7507f 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 ed1b4d3ebd026..80d0d1bc83b61 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 e1a9a02f9aaae..21d6a1bc1b360 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 1b766f785a524..3bf3ce88a63c2 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 8108ea7bd503c..89ae85ec99027 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 864866a12e80c..3a360d8f4681f 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 4d6aeb45cc94f..e7fd7a1961e0a 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 51307435fabda..3d4ed526b6ace 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 5f566b97b3d41..21370b329a344 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 d607fad9bf3f3..fd12d86144c9c 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 f9302fef1aaf9..d322e9ffe68cd 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 8606ca3c308c0..ad8da4d18601c 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 3ec45531d0aa6..4a2b95ada6d21 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 678e95147c30d..13bce27bb8344 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 5932a06778cc5..150de9e63d39d 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 5ff2ceadb07ca..812ed256a5d32 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 4751cff4373bd..2d036b0cf3792 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 522df6b5e6610..ce57a3454bb21 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 fc2736e3aa531..a5211d83f845d 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 6148c077210d5..45dacf22cfa3a 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 2f0caec0376bb..3a1edb9ffc911 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 c8d3cede406a9..e68f744555809 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 af5e5e8dfcd87..7a5c27afca552 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 a9b276fc81439..90debfc337d83 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 58353052b410b..589e5fcc00ead 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 e295463813915..7fa71e4dd1a55 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 2d4551c55ed46..ff0d58abc3ada 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 112ea905025ef..2297fea635363 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 31463992aca04..161f7e93af839 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 cd8f6b975b68f..0b72c5cf734c6 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 e07080f609f92..4c3cac3369136 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 a941c5bf1ab19..00ef1a7ff9269 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 c93b545afb994..cd1a85a9d2442 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 9b669bc4bb8e8..1faabac2bcdac 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 5bbccba39d8a2..9a3e384b9d1c9 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` | ------------^^^