-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTA-visibilityArea: Visibility / privacyArea: Visibility / privacyC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
so61pi and SwannHERRERA
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTA-visibilityArea: Visibility / privacyArea: Visibility / privacyC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.