]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0577.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0577.md
1 Something other than a module was found in visibility scope.
2
3 Erroneous code example:
4
5 ```compile_fail,E0577,edition2018
6 pub struct Sea;
7
8 pub (in crate::Sea) struct Shark; // error!
9
10 fn main() {}
11 ```
12
13 `Sea` is not a module, therefore it is invalid to use it in a visibility path.
14 To fix this error we need to ensure `Sea` is a module.
15
16 Please note that the visibility scope can only be applied on ancestors!
17
18 ```edition2018
19 pub mod Sea {
20 pub (in crate::Sea) struct Shark; // ok!
21 }
22
23 fn main() {}
24 ```