Rollup merge of #49166 - dileepbapat:pr-49133, r=nikomatsakis

#49133 - Reworded the Error message: "`pub` not needed here" message
This commit is contained in:
kennytm 2018-03-20 07:15:32 +08:00
commit c152e98a75
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C
2 changed files with 4 additions and 4 deletions

View file

@ -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);

View file

@ -2,7 +2,7 @@ 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
@ -10,13 +10,13 @@ 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