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