Currently, the target of a use statement will be updated with the visibility of the use statement itself (if the use statement was visible). This commit ensures that if the path to the target item is via another use statement then that intermediate use statement will also have the visibility updated like the target. This silences incorrect `unreachable_pub` lints with inactionable suggestions.
18 lines
237 B
Rust
18 lines
237 B
Rust
// compile-pass
|
|
|
|
// Tests that the `unreachable_pub` lint doesn't fire for `pub self::imp::f`.
|
|
|
|
#![deny(unreachable_pub)]
|
|
|
|
mod m {
|
|
mod imp {
|
|
pub fn f() {}
|
|
}
|
|
|
|
pub use self::imp::f;
|
|
}
|
|
|
|
pub use self::m::f;
|
|
|
|
fn main() {}
|