2019-10-27 23:57:25 +00:00
|
|
|
#![warn(unused_imports)]
|
|
|
|
|
2016-08-19 22:52:26 +00:00
|
|
|
mod a {
|
|
|
|
fn foo() {}
|
|
|
|
mod foo {}
|
|
|
|
|
|
|
|
mod a {
|
2018-01-12 21:41:45 +00:00
|
|
|
pub use super::foo; //~ ERROR cannot be re-exported
|
2019-10-27 23:57:25 +00:00
|
|
|
pub use super::*;
|
|
|
|
//~^ WARNING glob import doesn't reexport anything because no candidate is public enough
|
2016-08-19 22:52:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod b {
|
|
|
|
pub fn foo() {}
|
2019-10-27 23:57:25 +00:00
|
|
|
mod foo {
|
|
|
|
pub struct S;
|
|
|
|
}
|
2016-08-19 22:52:26 +00:00
|
|
|
|
|
|
|
pub mod a {
|
|
|
|
pub use super::foo; // This is OK since the value `foo` is visible enough.
|
2018-01-12 21:41:45 +00:00
|
|
|
fn f(_: foo::S) {} // `foo` is imported in the type namespace (but not `pub` re-exported).
|
2016-08-19 22:52:26 +00:00
|
|
|
}
|
2016-08-20 00:33:06 +00:00
|
|
|
|
|
|
|
pub mod b {
|
|
|
|
pub use super::*; // This is also OK since the value `foo` is visible enough.
|
2018-01-12 21:41:45 +00:00
|
|
|
fn f(_: foo::S) {} // Again, the module `foo` is imported (but not `pub` re-exported).
|
2016-08-20 00:33:06 +00:00
|
|
|
}
|
2016-08-19 22:52:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mod c {
|
2018-01-12 21:41:45 +00:00
|
|
|
// Test that `foo` is not re-exported.
|
2016-08-19 22:52:26 +00:00
|
|
|
use b::a::foo::S; //~ ERROR `foo`
|
2016-08-20 00:33:06 +00:00
|
|
|
use b::b::foo::S as T; //~ ERROR `foo`
|
2016-08-19 22:52:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|