]> git.proxmox.com Git - rustc.git/blob - compiler/rustc_error_codes/src/error_codes/E0364.md
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / compiler / rustc_error_codes / src / 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,E0364
7 mod a {
8 fn foo() {}
9
10 mod a {
11 pub use super::foo; // error!
12 }
13 }
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 a {
21 pub fn foo() {} // ok!
22
23 mod a {
24 pub use super::foo;
25 }
26 }
27 ```
28
29 See the [Use Declarations][use-declarations] section of the reference for
30 more information on this topic.
31
32 [use-declarations]: https://doc.rust-lang.org/reference/items/use-declarations.html