diff options
Diffstat (limited to 'tests')
39 files changed, 208 insertions, 86 deletions
diff --git a/tests/ui/did_you_mean/issue-40006.rs b/tests/ui/did_you_mean/issue-40006.rs index 74f304d81a0..fff31bfc85e 100644 --- a/tests/ui/did_you_mean/issue-40006.rs +++ b/tests/ui/did_you_mean/issue-40006.rs @@ -5,7 +5,7 @@ impl dyn A { struct S; trait X { - X() {} //~ ERROR expected one of `!` or `::`, found `(` + X() {} //~ ERROR missing `fn` for function definition fn xxx() { ### } L = M; Z = { 2 + 3 }; @@ -13,7 +13,7 @@ trait X { } trait A { - X() {} //~ ERROR expected one of `!` or `::`, found `(` + X() {} //~ ERROR missing `fn` for function definition } trait B { fn xxx() { ### } //~ ERROR expected diff --git a/tests/ui/did_you_mean/issue-40006.stderr b/tests/ui/did_you_mean/issue-40006.stderr index bdbfa4dd713..303806a14de 100644 --- a/tests/ui/did_you_mean/issue-40006.stderr +++ b/tests/ui/did_you_mean/issue-40006.stderr @@ -11,26 +11,36 @@ LL | } | unexpected token | the item list ends here -error: expected one of `!` or `::`, found `(` - --> $DIR/issue-40006.rs:8:6 +error: missing `fn` for function definition + --> $DIR/issue-40006.rs:8:5 | LL | trait X { | - while parsing this item list starting here LL | X() {} - | ^ expected one of `!` or `::` + | ^ ... LL | } | - the item list ends here + | +help: add `fn` here to parse `X` as a function + | +LL | fn X() {} + | ++ -error: expected one of `!` or `::`, found `(` - --> $DIR/issue-40006.rs:16:6 +error: missing `fn` for function definition + --> $DIR/issue-40006.rs:16:5 | LL | trait A { | - while parsing this item list starting here LL | X() {} - | ^ expected one of `!` or `::` + | ^ LL | } | - the item list ends here + | +help: add `fn` here to parse `X` as a function + | +LL | fn X() {} + | ++ error: expected one of `!` or `[`, found `#` --> $DIR/issue-40006.rs:19:17 @@ -69,17 +79,17 @@ LL | } | - the item list ends here error: missing `fn` for method definition - --> $DIR/issue-40006.rs:32:8 + --> $DIR/issue-40006.rs:32:5 | LL | impl S { | - while parsing this item list starting here LL | pub hello_method(&self) { - | ^ + | ^^^^^^^^^^^^^^^^ ... LL | } | - the item list ends here | -help: add `fn` here to parse `hello_method` as a public method +help: add `fn` here to parse `hello_method` as a method | LL | pub fn hello_method(&self) { | ++ diff --git a/tests/ui/mismatched_types/recovered-block.rs b/tests/ui/mismatched_types/recovered-block.rs index a91bbe7083b..f3078f46489 100644 --- a/tests/ui/mismatched_types/recovered-block.rs +++ b/tests/ui/mismatched_types/recovered-block.rs @@ -10,6 +10,6 @@ pub fn foo() -> Foo { pub Foo { text } } -//~^^ ERROR missing `struct` for struct definition +//~^^ ERROR missing `enum` for enum definition fn main() {} diff --git a/tests/ui/mismatched_types/recovered-block.stderr b/tests/ui/mismatched_types/recovered-block.stderr index 51b5f3b1af2..35ce134ab61 100644 --- a/tests/ui/mismatched_types/recovered-block.stderr +++ b/tests/ui/mismatched_types/recovered-block.stderr @@ -1,13 +1,13 @@ -error: missing `struct` for struct definition - --> $DIR/recovered-block.rs:11:8 +error: missing `enum` for enum definition + --> $DIR/recovered-block.rs:11:5 | LL | pub Foo { text } - | ^ + | ^^^^^^^ | -help: add `struct` here to parse `Foo` as a public struct +help: add `enum` here to parse `Foo` as an enum | -LL | pub struct Foo { text } - | ++++++ +LL | pub enum Foo { text } + | ++++ error: aborting due to 1 previous error diff --git a/tests/ui/parser/extern-no-fn.rs b/tests/ui/parser/extern-no-fn.rs index 73568609cdf..e965b390f07 100644 --- a/tests/ui/parser/extern-no-fn.rs +++ b/tests/ui/parser/extern-no-fn.rs @@ -1,5 +1,7 @@ extern "C" { - f(); //~ ERROR expected one of `!` or `::`, found `(` + f(); + //~^ ERROR missing `fn` or `struct` for function or struct definition + //~| HELP if you meant to call a macro, try } fn main() { diff --git a/tests/ui/parser/extern-no-fn.stderr b/tests/ui/parser/extern-no-fn.stderr index 2e434afb218..03826e4a93b 100644 --- a/tests/ui/parser/extern-no-fn.stderr +++ b/tests/ui/parser/extern-no-fn.stderr @@ -1,12 +1,18 @@ -error: expected one of `!` or `::`, found `(` - --> $DIR/extern-no-fn.rs:2:6 +error: missing `fn` or `struct` for function or struct definition + --> $DIR/extern-no-fn.rs:2:5 | LL | extern "C" { | - while parsing this item list starting here LL | f(); - | ^ expected one of `!` or `::` + | ^ +... LL | } | - the item list ends here + | +help: if you meant to call a macro, try + | +LL | f!(); + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/missing-enum-issue-125446.rs b/tests/ui/parser/missing-enum-issue-125446.rs new file mode 100644 index 00000000000..8d2cdb0dc40 --- /dev/null +++ b/tests/ui/parser/missing-enum-issue-125446.rs @@ -0,0 +1,6 @@ +Whoops { +//~^ ERROR missing `enum` for enum definition +//~| HELP add `enum` here to parse `Whoops` as an enum + OptionA, + OptionB, +} diff --git a/tests/ui/parser/missing-enum-issue-125446.stderr b/tests/ui/parser/missing-enum-issue-125446.stderr new file mode 100644 index 00000000000..113b147473c --- /dev/null +++ b/tests/ui/parser/missing-enum-issue-125446.stderr @@ -0,0 +1,13 @@ +error: missing `enum` for enum definition + --> $DIR/missing-enum-issue-125446.rs:1:1 + | +LL | Whoops { + | ^^^^^^ + | +help: add `enum` here to parse `Whoops` as an enum + | +LL | enum Whoops { + | ++++ + +error: aborting due to 1 previous error + diff --git a/tests/ui/parser/missing-enum-or-struct-issue-125446.rs b/tests/ui/parser/missing-enum-or-struct-issue-125446.rs new file mode 100644 index 00000000000..c817ffaf859 --- /dev/null +++ b/tests/ui/parser/missing-enum-or-struct-issue-125446.rs @@ -0,0 +1,2 @@ +Whoops {} +//~^ ERROR missing `enum` or `struct` for enum or struct definition diff --git a/tests/ui/parser/missing-enum-or-struct-issue-125446.stderr b/tests/ui/parser/missing-enum-or-struct-issue-125446.stderr new file mode 100644 index 00000000000..15916cebf45 --- /dev/null +++ b/tests/ui/parser/missing-enum-or-struct-issue-125446.stderr @@ -0,0 +1,8 @@ +error: missing `enum` or `struct` for enum or struct definition + --> $DIR/missing-enum-or-struct-issue-125446.rs:1:1 + | +LL | Whoops {} + | ^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/parser/missing-fn-issue-125446.rs b/tests/ui/parser/missing-fn-issue-125446.rs new file mode 100644 index 00000000000..73c9c3a60e1 --- /dev/null +++ b/tests/ui/parser/missing-fn-issue-125446.rs @@ -0,0 +1,7 @@ +whoops() {} +//~^ ERROR missing `fn` for function definition +//~| HELP add `fn` here to parse `whoops` as a function + +fn main() { + whoops(); +} diff --git a/tests/ui/parser/missing-fn-issue-125446.stderr b/tests/ui/parser/missing-fn-issue-125446.stderr new file mode 100644 index 00000000000..2a92e0062cb --- /dev/null +++ b/tests/ui/parser/missing-fn-issue-125446.stderr @@ -0,0 +1,13 @@ +error: missing `fn` for function definition + --> $DIR/missing-fn-issue-125446.rs:1:1 + | +LL | whoops() {} + | ^^^^^^ + | +help: add `fn` here to parse `whoops` as a function + | +LL | fn whoops() {} + | ++ + +error: aborting due to 1 previous error + diff --git a/tests/ui/parser/missing-fn-issue-65381-1.rs b/tests/ui/parser/missing-fn-issue-65381-1.rs new file mode 100644 index 00000000000..ac0299ae37b --- /dev/null +++ b/tests/ui/parser/missing-fn-issue-65381-1.rs @@ -0,0 +1,4 @@ +main() { +//~^ ERROR missing `fn` for function definition +//~| HELP add `fn` here to parse `main` as a function +} diff --git a/tests/ui/parser/missing-fn-issue-65381-1.stderr b/tests/ui/parser/missing-fn-issue-65381-1.stderr new file mode 100644 index 00000000000..95ccd8518ee --- /dev/null +++ b/tests/ui/parser/missing-fn-issue-65381-1.stderr @@ -0,0 +1,13 @@ +error: missing `fn` for function definition + --> $DIR/missing-fn-issue-65381-1.rs:1:1 + | +LL | main() { + | ^^^^ + | +help: add `fn` here to parse `main` as a function + | +LL | fn main() { + | ++ + +error: aborting due to 1 previous error + diff --git a/tests/ui/parser/missing-fn-issue-65381-2.rs b/tests/ui/parser/missing-fn-issue-65381-2.rs new file mode 100644 index 00000000000..e8c214a58b6 --- /dev/null +++ b/tests/ui/parser/missing-fn-issue-65381-2.rs @@ -0,0 +1,3 @@ +main(); +//~^ ERROR missing `fn` or `struct` for function or struct definition +//~| HELP if you meant to call a macro, try diff --git a/tests/ui/parser/missing-fn-issue-65381-2.stderr b/tests/ui/parser/missing-fn-issue-65381-2.stderr new file mode 100644 index 00000000000..e13d395d70d --- /dev/null +++ b/tests/ui/parser/missing-fn-issue-65381-2.stderr @@ -0,0 +1,13 @@ +error: missing `fn` or `struct` for function or struct definition + --> $DIR/missing-fn-issue-65381-2.rs:1:1 + | +LL | main(); + | ^^^^ + | +help: if you meant to call a macro, try + | +LL | main!(); + | ~~~~~ + +error: aborting due to 1 previous error + diff --git a/tests/ui/parser/missing-fn-issue-65381-3.rs b/tests/ui/parser/missing-fn-issue-65381-3.rs new file mode 100644 index 00000000000..28e5b5aa430 --- /dev/null +++ b/tests/ui/parser/missing-fn-issue-65381-3.rs @@ -0,0 +1,4 @@ +pub const initial_value() -> Self { +//~^ ERROR missing `fn` for function definition +//~| HELP add `fn` here to parse `initial_value` as a function +} diff --git a/tests/ui/parser/missing-fn-issue-65381-3.stderr b/tests/ui/parser/missing-fn-issue-65381-3.stderr new file mode 100644 index 00000000000..883295baede --- /dev/null +++ b/tests/ui/parser/missing-fn-issue-65381-3.stderr @@ -0,0 +1,13 @@ +error: missing `fn` for function definition + --> $DIR/missing-fn-issue-65381-3.rs:1:11 + | +LL | pub const initial_value() -> Self { + | ^^^^^^^^^^^^^ + | +help: add `fn` here to parse `initial_value` as a function + | +LL | pub const fn initial_value() -> Self { + | ++ + +error: aborting due to 1 previous error + diff --git a/tests/ui/parser/missing-struct-issue-125446.rs b/tests/ui/parser/missing-struct-issue-125446.rs new file mode 100644 index 00000000000..439087aeec9 --- /dev/null +++ b/tests/ui/parser/missing-struct-issue-125446.rs @@ -0,0 +1,5 @@ +Whoops { +//~^ ERROR missing `struct` for struct definition +//~| HELP add `struct` here to parse `Whoops` as a struct + value: u64, +} diff --git a/tests/ui/parser/missing-struct-issue-125446.stderr b/tests/ui/parser/missing-struct-issue-125446.stderr new file mode 100644 index 00000000000..ff3135b2357 --- /dev/null +++ b/tests/ui/parser/missing-struct-issue-125446.stderr @@ -0,0 +1,13 @@ +error: missing `struct` for struct definition + --> $DIR/missing-struct-issue-125446.rs:1:1 + | +LL | Whoops { + | ^^^^^^ + | +help: add `struct` here to parse `Whoops` as a struct + | +LL | struct Whoops { + | ++++++ + +error: aborting due to 1 previous error + diff --git a/tests/ui/pub/pub-ident-fn-2.stderr b/tests/ui/pub/pub-ident-fn-2.stderr index e724278b233..80f4b14da89 100644 --- a/tests/ui/pub/pub-ident-fn-2.stderr +++ b/tests/ui/pub/pub-ident-fn-2.stderr @@ -1,10 +1,10 @@ error: missing `fn` for function definition - --> $DIR/pub-ident-fn-2.rs:3:4 + --> $DIR/pub-ident-fn-2.rs:3:1 | LL | pub foo(_s: usize) { bar() } - | ^ + | ^^^^^^^ | -help: add `fn` here to parse `foo` as a public function +help: add `fn` here to parse `foo` as a function | LL | pub fn foo(_s: usize) { bar() } | ++ diff --git a/tests/ui/pub/pub-ident-fn-or-struct.stderr b/tests/ui/pub/pub-ident-fn-or-struct.stderr index a8fa4bd3bd3..ceadc510c63 100644 --- a/tests/ui/pub/pub-ident-fn-or-struct.stderr +++ b/tests/ui/pub/pub-ident-fn-or-struct.stderr @@ -1,8 +1,13 @@ error: missing `fn` or `struct` for function or struct definition - --> $DIR/pub-ident-fn-or-struct.rs:1:4 + --> $DIR/pub-ident-fn-or-struct.rs:1:1 | LL | pub S (foo) bar - | ---^- help: if you meant to call a macro, try: `S!` + | ^^^^^ + | +help: if you meant to call a macro, try + | +LL | pub S! (foo) bar + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/pub/pub-ident-fn-with-lifetime-2.rs b/tests/ui/pub/pub-ident-fn-with-lifetime-2.rs index 1ee8c84f13b..3fb93cb669b 100644 --- a/tests/ui/pub/pub-ident-fn-with-lifetime-2.rs +++ b/tests/ui/pub/pub-ident-fn-with-lifetime-2.rs @@ -1,4 +1,4 @@ -pub bar<'a>(&self, _s: &'a usize) -> bool { true } +pub bar<'a>(&self, _s: &'a usize) -> bool { true } //~^ ERROR missing `fn` for method definition fn main() { diff --git a/tests/ui/pub/pub-ident-fn-with-lifetime-2.stderr b/tests/ui/pub/pub-ident-fn-with-lifetime-2.stderr index b0d5ce9de5c..e6523ca58ab 100644 --- a/tests/ui/pub/pub-ident-fn-with-lifetime-2.stderr +++ b/tests/ui/pub/pub-ident-fn-with-lifetime-2.stderr @@ -1,10 +1,10 @@ error: missing `fn` for method definition - --> $DIR/pub-ident-fn-with-lifetime-2.rs:1:4 + --> $DIR/pub-ident-fn-with-lifetime-2.rs:1:1 | -LL | pub bar<'a>(&self, _s: &'a usize) -> bool { true } - | ^^^ +LL | pub bar<'a>(&self, _s: &'a usize) -> bool { true } + | ^^^^^^^ | -help: add `fn` here to parse `bar` as a public method +help: add `fn` here to parse `bar` as a method | LL | pub fn bar<'a>(&self, _s: &'a usize) -> bool { true } | ++ diff --git a/tests/ui/pub/pub-ident-fn-with-lifetime.rs b/tests/ui/pub/pub-ident-fn-with-lifetime.rs index 8cdc152f163..0fd25ca0b1c 100644 --- a/tests/ui/pub/pub-ident-fn-with-lifetime.rs +++ b/tests/ui/pub/pub-ident-fn-with-lifetime.rs @@ -1,6 +1,6 @@ //@ run-rustfix -pub foo<'a>(_s: &'a usize) -> bool { true } +pub foo<'a>(_s: &'a usize) -> bool { true } //~^ ERROR missing `fn` for function definition fn main() { diff --git a/tests/ui/pub/pub-ident-fn-with-lifetime.stderr b/tests/ui/pub/pub-ident-fn-with-lifetime.stderr index 63fcf6bf5d5..52c6206a75f 100644 --- a/tests/ui/pub/pub-ident-fn-with-lifetime.stderr +++ b/tests/ui/pub/pub-ident-fn-with-lifetime.stderr @@ -1,10 +1,10 @@ error: missing `fn` for function definition - --> $DIR/pub-ident-fn-with-lifetime.rs:3:4 + --> $DIR/pub-ident-fn-with-lifetime.rs:3:1 | -LL | pub foo<'a>(_s: &'a usize) -> bool { true } - | ^^^ +LL | pub foo<'a>(_s: &'a usize) -> bool { true } + | ^^^^^^^ | -help: add `fn` here to parse `foo` as a public function +help: add `fn` here to parse `foo` as a function | LL | pub fn foo<'a>(_s: &'a usize) -> bool { true } | ++ diff --git a/tests/ui/pub/pub-ident-fn.rs b/tests/ui/pub/pub-ident-fn.rs index 899ea82ccb7..1032f3375ea 100644 --- a/tests/ui/pub/pub-ident-fn.rs +++ b/tests/ui/pub/pub-ident-fn.rs @@ -1,6 +1,6 @@ //@ run-rustfix -pub foo(_s: usize) -> bool { true } +pub foo(_s: usize) -> bool { true } //~^ ERROR missing `fn` for function definition fn main() { diff --git a/tests/ui/pub/pub-ident-fn.stderr b/tests/ui/pub/pub-ident-fn.stderr index 06dac616443..54360061fef 100644 --- a/tests/ui/pub/pub-ident-fn.stderr +++ b/tests/ui/pub/pub-ident-fn.stderr @@ -1,10 +1,10 @@ error: missing `fn` for function definition - --> $DIR/pub-ident-fn.rs:3:4 + --> $DIR/pub-ident-fn.rs:3:1 | -LL | pub foo(_s: usize) -> bool { true } - | ^^^ +LL | pub foo(_s: usize) -> bool { true } + | ^^^^^^^ | -help: add `fn` here to parse `foo` as a public function +help: add `fn` here to parse `foo` as a function | LL | pub fn foo(_s: usize) -> bool { true } | ++ diff --git a/tests/ui/pub/pub-ident-struct-2.stderr b/tests/ui/pub/pub-ident-struct-2.stderr index 5e0f328d986..ef2ff1d2f0e 100644 --- a/tests/ui/pub/pub-ident-struct-2.stderr +++ b/tests/ui/pub/pub-ident-struct-2.stderr @@ -1,10 +1,10 @@ error: missing `struct` for struct definition - --> $DIR/pub-ident-struct-2.rs:4:8 + --> $DIR/pub-ident-struct-2.rs:4:5 | LL | pub bar(); - | ^ + | ^^^^^^^ | -help: add `struct` here to parse `bar` as a public struct +help: add `struct` here to parse `bar` as a struct | LL | pub struct bar(); | ++++++ diff --git a/tests/ui/pub/pub-ident-struct-3.stderr b/tests/ui/pub/pub-ident-struct-3.stderr index d08e5120570..0a23ad51211 100644 --- a/tests/ui/pub/pub-ident-struct-3.stderr +++ b/tests/ui/pub/pub-ident-struct-3.stderr @@ -1,10 +1,10 @@ error: missing `struct` for struct definition - --> $DIR/pub-ident-struct-3.rs:1:4 + --> $DIR/pub-ident-struct-3.rs:1:1 | LL | pub S(); - | ^ + | ^^^^^ | -help: add `struct` here to parse `S` as a public struct +help: add `struct` here to parse `S` as a struct | LL | pub struct S(); | ++++++ diff --git a/tests/ui/pub/pub-ident-struct-4.stderr b/tests/ui/pub/pub-ident-struct-4.stderr index ec136783211..d3072464e05 100644 --- a/tests/ui/pub/pub-ident-struct-4.stderr +++ b/tests/ui/pub/pub-ident-struct-4.stderr @@ -1,10 +1,10 @@ error: missing `struct` for struct definition - --> $DIR/pub-ident-struct-4.rs:4:4 + --> $DIR/pub-ident-struct-4.rs:4:1 | LL | pub T(String); - | ^ + | ^^^^^ | -help: add `struct` here to parse `T` as a public struct +help: add `struct` here to parse `T` as a struct | LL | pub struct T(String); | ++++++ diff --git a/tests/ui/pub/pub-ident-struct-with-lifetime.rs b/tests/ui/pub/pub-ident-struct-with-lifetime.rs index 2feb0266070..baa5dc8cfb9 100644 --- a/tests/ui/pub/pub-ident-struct-with-lifetime.rs +++ b/tests/ui/pub/pub-ident-struct-with-lifetime.rs @@ -1,4 +1,4 @@ pub S<'a> { -//~^ ERROR missing `struct` for struct definition +//~^ ERROR missing `enum` or `struct` for enum or struct definition } fn main() {} diff --git a/tests/ui/pub/pub-ident-struct-with-lifetime.stderr b/tests/ui/pub/pub-ident-struct-with-lifetime.stderr index 0e08a5ff449..1367c941f80 100644 --- a/tests/ui/pub/pub-ident-struct-with-lifetime.stderr +++ b/tests/ui/pub/pub-ident-struct-with-lifetime.stderr @@ -1,13 +1,8 @@ -error: missing `struct` for struct definition - --> $DIR/pub-ident-struct-with-lifetime.rs:1:4 +error: missing `enum` or `struct` for enum or struct definition + --> $DIR/pub-ident-struct-with-lifetime.rs:1:1 | LL | pub S<'a> { - | ^ - | -help: add `struct` here to parse `S` as a public struct - | -LL | pub struct S<'a> { - | ++++++ + | ^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/pub/pub-ident-struct.fixed b/tests/ui/pub/pub-ident-struct.fixed deleted file mode 100644 index 3f0610cd765..00000000000 --- a/tests/ui/pub/pub-ident-struct.fixed +++ /dev/null @@ -1,6 +0,0 @@ -//@ run-rustfix - -pub struct S { -//~^ ERROR missing `struct` for struct definition -} -fn main() {} diff --git a/tests/ui/pub/pub-ident-struct.rs b/tests/ui/pub/pub-ident-struct.rs index 6d06c406f6c..f9f31a9ed2b 100644 --- a/tests/ui/pub/pub-ident-struct.rs +++ b/tests/ui/pub/pub-ident-struct.rs @@ -1,6 +1,4 @@ -//@ run-rustfix - pub S { -//~^ ERROR missing `struct` for struct definition +//~^ ERROR missing `enum` or `struct` for enum or struct definition } fn main() {} diff --git a/tests/ui/pub/pub-ident-struct.stderr b/tests/ui/pub/pub-ident-struct.stderr index 2d5d61d9381..6d85305ceaf 100644 --- a/tests/ui/pub/pub-ident-struct.stderr +++ b/tests/ui/pub/pub-ident-struct.stderr @@ -1,13 +1,8 @@ -error: missing `struct` for struct definition - --> $DIR/pub-ident-struct.rs:3:4 +error: missing `enum` or `struct` for enum or struct definition + --> $DIR/pub-ident-struct.rs:1:1 | LL | pub S { - | ^ - | -help: add `struct` here to parse `S` as a public struct - | -LL | pub struct S { - | ++++++ + | ^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/pub/pub-ident-with-lifetime-incomplete.rs b/tests/ui/pub/pub-ident-with-lifetime-incomplete.rs index c86a9f2fdd6..dec1a502646 100644 --- a/tests/ui/pub/pub-ident-with-lifetime-incomplete.rs +++ b/tests/ui/pub/pub-ident-with-lifetime-incomplete.rs @@ -1,5 +1,5 @@ fn main() { } -pub foo<'a> +pub foo<'a> //~^ ERROR missing `fn` or `struct` for function or struct definition diff --git a/tests/ui/pub/pub-ident-with-lifetime-incomplete.stderr b/tests/ui/pub/pub-ident-with-lifetime-incomplete.stderr index 750e2d17e0a..67b6b9c7ba8 100644 --- a/tests/ui/pub/pub-ident-with-lifetime-incomplete.stderr +++ b/tests/ui/pub/pub-ident-with-lifetime-incomplete.stderr @@ -1,8 +1,8 @@ error: missing `fn` or `struct` for function or struct definition - --> $DIR/pub-ident-with-lifetime-incomplete.rs:4:4 + --> $DIR/pub-ident-with-lifetime-incomplete.rs:4:1 | -LL | pub foo<'a> - | ^^^ +LL | pub foo<'a> + | ^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/track-diagnostics/track4.stderr b/tests/ui/track-diagnostics/track4.stderr index d9eaea93638..19499fa7abc 100644 --- a/tests/ui/track-diagnostics/track4.stderr +++ b/tests/ui/track-diagnostics/track4.stderr @@ -1,14 +1,14 @@ -error: missing `struct` for struct definition +error: missing `enum` for enum definition --> $DIR/track4.rs:LL:CC | LL | pub onion { - | ^ + | ^^^^^^^^^ -Ztrack-diagnostics: created at compiler/rustc_parse/src/parser/item.rs:LL:CC | -help: add `struct` here to parse `onion` as a public struct +help: add `enum` here to parse `onion` as an enum | -LL | pub struct onion { - | ++++++ +LL | pub enum onion { + | ++++ error: aborting due to 1 previous error |
