Update test to new error message

This commit is contained in:
Alexis Bourget 2021-10-24 15:11:11 +02:00
parent 5c9950023b
commit b0806b2de9
7 changed files with 18 additions and 16 deletions

View File

@ -2026,7 +2026,7 @@ enum WrongKw {
else {
err.span_suggestion(
current_vis.span,
"there is already a visibility, remove this one",
"there is already a visibility modifier, remove one",
"".to_string(),
Applicability::MachineApplicable,
)

View File

@ -4,6 +4,6 @@ fn main() {}
pub pub fn foo();
//~^ ERROR expected one of `(`, `async`, `const`, `default`, `extern`, `fn`, `pub`, `unsafe`, or `use`, found keyword `pub`
//~| NOTE expected one of 9 possible tokens
//~| HELP there is already a visibility, remove this one
//~| HELP there is already a visibility modifier, remove one
//~| NOTE explicit visibility first seen here
} //~ NOTE the item list ends here

View File

@ -7,7 +7,7 @@ LL | pub pub fn foo();
| ^^^
| |
| expected one of 9 possible tokens
| help: there is already a visibility, remove this one
| help: there is already a visibility modifier, remove one
...
LL | }
| - the item list ends here

View File

@ -1,5 +1,5 @@
pub const pub fn test() {}
//~^ ERROR expected one of `async`, `extern`, `fn`, or `unsafe`, found keyword `pub`
//~| NOTE expected one of `async`, `extern`, `fn`, or `unsafe`
//~| HELP there is already a visibility, remove this one
//~| HELP there is already a visibility modifier, remove one
//~| NOTE explicit visibility first seen here

View File

@ -5,7 +5,7 @@ LL | pub const pub fn test() {}
| ^^^
| |
| expected one of `async`, `extern`, `fn`, or `unsafe`
| help: there is already a visibility, remove this one
| help: there is already a visibility modifier, remove one
|
note: explicit visibility first seen here
--> $DIR/issue-87694-duplicated-pub.rs:1:1

View File

@ -1,11 +1,9 @@
// edition:2018
// Test that even when `const` is already present, the proposed fix is `const const async`,
// like for `pub pub`.
// Test that even when `const` is already present, the proposed fix is to remove the second `const`
const async const fn test() {}
//~^ ERROR expected one of `extern`, `fn`, or `unsafe`, found keyword `const`
//~| NOTE expected one of `extern`, `fn`, or `unsafe`
//~| HELP `const` must come before `async`
//~| SUGGESTION const async
//~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
//~| HELP `const` already used earlier, remove this one
//~| NOTE `const` first seen here

View File

@ -1,13 +1,17 @@
error: expected one of `extern`, `fn`, or `unsafe`, found keyword `const`
--> $DIR/const-async-const.rs:6:13
--> $DIR/const-async-const.rs:5:13
|
LL | const async const fn test() {}
| ------^^^^^
| | |
| | expected one of `extern`, `fn`, or `unsafe`
| help: `const` must come before `async`: `const async`
| ^^^^^
| |
| expected one of `extern`, `fn`, or `unsafe`
| help: `const` already used earlier, remove this one
|
= note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
note: `const` first seen here
--> $DIR/const-async-const.rs:5:1
|
LL | const async const fn test() {}
| ^^^^^
error: aborting due to previous error