]> git.lizzy.rs Git - rust.git/blob - src/test/ui/imports/reexports.rs
Sync portable-simd to rust-lang/portable-simd@72df4c45056a8bc0d1b3f06fdc828722177f0763
[rust.git] / src / test / ui / imports / reexports.rs
1 #![warn(unused_imports)]
2
3 mod a {
4     fn foo() {}
5     mod foo {}
6
7     mod a {
8         pub use super::foo; //~ ERROR cannot be re-exported
9         pub use super::*;
10         //~^ WARNING glob import doesn't reexport anything because no candidate is public enough
11     }
12 }
13
14 mod b {
15     pub fn foo() {}
16     mod foo {
17         pub struct S;
18     }
19
20     pub mod a {
21         pub use super::foo; // This is OK since the value `foo` is visible enough.
22         fn f(_: foo::S) {} // `foo` is imported in the type namespace (but not `pub` re-exported).
23     }
24
25     pub mod b {
26         pub use super::*; // This is also OK since the value `foo` is visible enough.
27         fn f(_: foo::S) {} // Again, the module `foo` is imported (but not `pub` re-exported).
28     }
29 }
30
31 mod c {
32     // Test that `foo` is not re-exported.
33     use b::a::foo::S; //~ ERROR `foo`
34     use b::b::foo::S as T; //~ ERROR `foo`
35 }
36
37 fn main() {}