Closed
Description
Code
trait Fun {
pub fn test() {}
}
Current output
error[E0449]: visibility qualifiers are not permitted here
--> src/main.rs:2:5
|
2 | pub fn test() {}
| ^^^
|
= note: trait items always share the visibility of their trait
Desired output
error[E0449]: visibility qualifiers are not permitted here
--> src/main.rs:2:5
|
2 | pub fn test() {}
| ^^^
|
= note: trait items always share the visibility of their trait
help: remove the qualifier
|
2 | fn test() {}
|
Rationale and extra context
This error has a very trivial no-nonsense solution, and it would be nice for the compiler to provide a suggestion so that it can can easily be fixed with cargo fix
.
Other cases
No response
Rust Version
$ rustc --version --verbose
rustc 1.79.0-nightly (0ad927c0c 2024-03-21)
binary: rustc
commit-hash: 0ad927c0c07b65fc0dae37105e09c877c87c296a
commit-date: 2024-03-21
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.2
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.