Skip to content

#49133 - Reworded the Error message: "pub not needed here" message #49166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc_passes/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl<'a> AstValidator<'a> {
E0449,
"unnecessary visibility qualifier");
if vis.node == VisibilityKind::Public {
err.span_label(vis.span, "`pub` not needed here");
err.span_label(vis.span, "`pub` not permitted here because it's implied");
}
if let Some(note) = note {
err.note(note);
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/error-codes/E0449.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ error[E0449]: unnecessary visibility qualifier
--> $DIR/E0449.rs:17:1
|
LL | pub impl Bar {} //~ ERROR E0449
| ^^^ `pub` not needed here
| ^^^ `pub` not permitted here because it's implied
|
= note: place qualifiers on individual impl items instead

error[E0449]: unnecessary visibility qualifier
--> $DIR/E0449.rs:19:1
|
LL | pub impl Foo for Bar { //~ ERROR E0449
| ^^^ `pub` not needed here
| ^^^ `pub` not permitted here because it's implied

error[E0449]: unnecessary visibility qualifier
--> $DIR/E0449.rs:20:5
|
LL | pub fn foo() {} //~ ERROR E0449
| ^^^ `pub` not needed here
| ^^^ `pub` not permitted here because it's implied

error: aborting due to 3 previous errors

Expand Down