Closed
Description
mod foo {
pub use self::bar::X;
#[cfg(bug)]
use self::bar::X;
mod bar {
pub struct X;
}
}
fn main() {
let _ = foo::X;
}
Just rustc 14386.rs
compiles fine, but rustc --cfg bug 14386.rs
fails with:
14386.rs:11:13: 11:19 error: unresolved name `foo::X`.
14386.rs:11 let _ = foo::X;
^~~~~~
error: aborting due to previous error
Original report:
Re-using a re-exported item confuses the visible_private_types lint
pub use sub::Foo;
use sub::Foo;
mod sub {
pub struct Foo;
}
pub fn blah() -> Foo {
Foo
}
gives a warning:
private type in exported type signature, #[warn(visible_private_types)] on by default (rust)
Removing the use sub::Foo;
line resolves this warning.