You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
warning: unreachable `pub` item
--> src/lib.rs:6:5
|
6 | pub use self::imp::f; // Recommends pub(crate), but that causes an error above.
| ---^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
note: lint level defined here
--> src/lib.rs:1:9
|
1 | #![warn(unreachable_pub)]
| ^^^^^^^^^^^^^^^
= help: or consider exporting it for use by other crates
Finished dev [unoptimized + debuginfo] target(s) in 0.57s
but the suggestions, when applied, doesn't compile!
The text was updated successfully, but these errors were encountered:
Wouldn't that be a change in semantics (m would be reachable by other users)? The original code looks correct to me. The use self::imp::f; item is reachable from the root re-export. It seems to me that the lint shouldn't fire in this case.
Update visibility of intermediate use items.
Fixesrust-lang#57410 and fixesrust-lang#53925 and fixesrust-lang#47816.
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 PR 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.
Update visibility of intermediate use items.
Fixes#57410 and fixes#53925 and fixes#47816.
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 PR 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.
First reported upstream this code:
gives the warning:
but the suggestions, when applied, doesn't compile!
The text was updated successfully, but these errors were encountered: