f1()1 fn f1() {}
2 enum E1 { V }
3 struct S1 {
4     #[rustfmt::skip]
5     bar: i32,
6 }
7 mod m1 {
8     pub use ::f1; //~ ERROR `f1` is only public within the crate, and cannot be re-exported outside
9     pub use ::S1; //~ ERROR `S1` is only public within the crate, and cannot be re-exported outside
10     pub use ::E1; //~ ERROR `E1` is only public within the crate, and cannot be re-exported outside
11     pub use ::E1::V; //~ ERROR `V` is only public within the crate, and cannot be re-exported outside
12 }
13 
f2()14 pub(crate) fn f2() {}
15 pub(crate) enum E2 {
16     V
17 }
18 pub(crate) struct S2 {
19     #[rustfmt::skip]
20     bar: i32,
21 }
22 mod m2 {
23     pub use ::f2; //~ ERROR `f2` is only public within the crate, and cannot be re-exported outside
24     pub use ::S2; //~ ERROR `S2` is only public within the crate, and cannot be re-exported outside
25     pub use ::E2; //~ ERROR `E2` is only public within the crate, and cannot be re-exported outside
26     pub use ::E2::V; //~ ERROR `V` is only public within the crate, and cannot be re-exported outside
27 }
28 
29 mod m3 {
f3()30     pub(crate) fn f3() {}
31     pub(crate) enum E3 {
32         V
33     }
34     pub(crate) struct S3 {
35         #[rustfmt::skip]
36         bar: i32,
37     }
38 }
39 pub use m3::f3; //~ ERROR `f3` is only public within the crate, and cannot be re-exported outside
40 pub use m3::S3; //~ ERROR `S3` is only public within the crate, and cannot be re-exported outside
41 pub use m3::E3; //~ ERROR `E3` is only public within the crate, and cannot be re-exported outside
42 pub use m3::E3::V; //~ ERROR `V` is only public within the crate, and cannot be re-exported outside
43 
f4()44 pub(self) fn f4() {}
45 pub use ::f4 as f5; //~ ERROR `f4` is only public within the crate, and cannot be re-exported outside
46 
47 pub mod m10 {
48     pub mod m {
f6()49         pub(super) fn f6() {}
f7()50         pub(crate) fn f7() {}
f8()51         pub(in crate::m10) fn f8() {}
52     }
53     pub use self::m::f6; //~ ERROR `f6` is private, and cannot be re-exported
54     pub use self::m::f7; //~ ERROR `f7` is only public within the crate, and cannot be re-exported outside
55     pub use self::m::f8; //~ ERROR `f8` is private, and cannot be re-exported
56 }
57 pub use m10::m::f6; //~ ERROR function `f6` is private
58 pub use m10::m::f7; //~ ERROR `f7` is only public within the crate, and cannot be re-exported outside
59 pub use m10::m::f8; //~ ERROR function `f8` is private
60 
61 pub mod m11 {
f9()62     pub(self) fn f9() {}
63 }
64 pub use m11::f9; //~ ERROR function `f9` is private
65 
main()66 fn main() {}
67