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 31, 2019
2 parents 6cee78c + 125d60d commit 0bd4037
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
28 changes: 27 additions & 1 deletion src/librustc_resolve/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,33 @@ trait Hello {
```
"##,

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 @@ -1990,6 +2017,5 @@ fn main() {}
// E0427, merged into 530
// E0467, removed
// E0470, removed
E0577,
E0578,
}
2 changes: 1 addition & 1 deletion src/test/ui/resolve/resolve-bad-visibility.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ LL | pub(in too_soon) struct H;

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0433, E0742.
Some errors have detailed explanations: E0433, E0577, E0742.
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 0bd4037

Please sign in to comment.