]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0364.md
New upstream version 1.45.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0364.md
CommitLineData
60c5eb7d
XL
1Private items cannot be publicly re-exported. This error indicates that you
2attempted to `pub use` a type or value that was not itself public.
3
4Erroneous code example:
5
f9f354fc
XL
6```compile_fail,E0364
7mod a {
8 fn foo() {}
60c5eb7d 9
f9f354fc
XL
10 mod a {
11 pub use super::foo; // error!
12 }
13}
60c5eb7d
XL
14```
15
16The solution to this problem is to ensure that the items that you are
17re-exporting are themselves marked with `pub`:
18
19```
f9f354fc
XL
20mod a {
21 pub fn foo() {} // ok!
60c5eb7d 22
f9f354fc
XL
23 mod a {
24 pub use super::foo;
25 }
26}
60c5eb7d
XL
27```
28
74b04a01
XL
29See the [Use Declarations][use-declarations] section of the reference for
30more information on this topic.
60c5eb7d 31
74b04a01 32[use-declarations]: https://doc.rust-lang.org/reference/items/use-declarations.html