Skip to content

Commit

Permalink
Rollup merge of rust-lang#65434 - GuillaumeGomez:long-err-explanation…
Browse files Browse the repository at this point in the history
…-E0577, r=Dylan-DPC

Add long error explanation for E0577

Part of rust-lang#61137.

r? @kinnison
  • Loading branch information
Centril committed Oct 18, 2019
2 parents 001f69d + e417180 commit 030ed01
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
30 changes: 28 additions & 2 deletions src/librustc_resolve/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct Foo<U = (), T = U> {
}
```
Please also verify that this wasn't because of a name-clash and rename the type
Please also verify \hat this wasn't because of a name-clash and rename the type
parameter if so.
"##,

Expand Down Expand Up @@ -1735,6 +1735,33 @@ match eco {
```
"##,

E0577: r##"
Something other than a module was found in visibility scope.
Erroneous code example:
```compile_fail,E0577,edition2018
pub struct Sea;
pub (in crate::Sea) struct Shark; // error!
fn main() {}
```
`Sea` is not a module, therefore it is invalid to use it in a visibility path.
To fix this error we need to ensure `Sea` is a module.
Please note that the visibility scope can only be applied on ancestors!
```edition2018
pub mod Sea {
pub (in crate::Sea) struct Shark; // ok!
}
fn main() {}
```
"##,

E0603: r##"
A private item was used outside its scope.
Expand Down Expand Up @@ -1864,6 +1891,5 @@ struct Foo<X = Box<Self>> {
// E0470, removed
E0575,
E0576,
E0577,
E0578,
}
3 changes: 2 additions & 1 deletion src/test/ui/resolve/resolve-bad-visibility.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ LL | pub(in too_soon) struct H;

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0433`.
Some errors have detailed explanations: E0433, E0577.
For more information about an error, try `rustc --explain E0433`.
1 change: 1 addition & 0 deletions src/test/ui/span/visibility-ty-params.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ LL | m!{ m<> }

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0577`.

0 comments on commit 030ed01

Please sign in to comment.