]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0365.md
New upstream version 1.41.1+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0365.md
1 Private modules cannot be publicly re-exported. This error indicates that you
2 attempted to `pub use` a module that was not itself public.
3
4 Erroneous code example:
5
6 ```compile_fail,E0365
7 mod foo {
8 pub const X: u32 = 1;
9 }
10
11 pub use foo as foo2;
12
13 fn main() {}
14 ```
15
16 The solution to this problem is to ensure that the module that you are
17 re-exporting is itself marked with `pub`:
18
19 ```
20 pub mod foo {
21 pub const X: u32 = 1;
22 }
23
24 pub use foo as foo2;
25
26 fn main() {}
27 ```
28
29 See the 'Use Declarations' section of the reference for more information
30 on this topic:
31
32 https://doc.rust-lang.org/reference.html#use-declarations