Closed
Description
It may be possible that developers get mixed up where pub visibility needs to be shown.
error: expected item, found keyword `async`
--> src/lib.rs:1:1
|
1 | async pub fn t() {}
| ^^^^^ expected item
error: aborting due to previous error
error: expected identifier, found keyword `pub`
--> src/lib.rs:1:7
|
1 | const pub fn t() {}
| ^^^ expected identifier, found keyword
error: expected one of `:`, `;`, or `=`, found keyword `fn`
--> src/lib.rs:1:11
|
1 | const pub fn t() {}
| ^^ expected one of `:`, `;`, or `=`
error: missing type for `const` item
--> src/lib.rs:1:7
|
1 | const pub fn t() {}
| ^^^ help: provide a type for the item: `r#pub: <type>`
error: aborting due to 3 previous errors
I am working on the first one, the second one looks harder to solve so I am not solving it.
It would be good to suggest the developer that pub
needs to come before async
or const
. And I don't even know if async
should come before const
or the other way around.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: The lexing & parsing of Rust source code to an ASTArea: Visibility / privacyCategory: An issue proposing an enhancement or a PR with one.Diagnostics: Confusing error or lint that should be reworked.Relevant to the compiler team, which will review and decide on the PR/issue.