-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
This code (playground) trips unreachable_pub
lint (while being completely legit).
#![deny(unreachable_pub)]
pub use self::m1::{Item1, Item2};
mod m1 {
pub use self::m2::{Item1, Item2};
mod m2 {
pub struct Item1;
pub struct Item2;
}
}
However, if we break the top-level pub use ...
statement into two separate statements (playground) - unreachable_pub
lint convinces itself that the code is, indeed, legit.
#![deny(unreachable_pub)]
pub use self::m1::Item1;
pub use self::m1::Item2;
mod m1 {
pub use self::m2::{Item1, Item2};
mod m2 {
pub struct Item1;
pub struct Item2;
}
}
jyn514, jhpratt, yoshuawuyts, Dushistov, TehUncleDolan and 4 more
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.