Skip to content

Enable unreachable_pub lint in core#134286

Merged
bors merged 4 commits intorust-lang:masterfrom
Urgau:unreach_pub-std
Jan 21, 2025
Merged

Enable unreachable_pub lint in core#134286
bors merged 4 commits intorust-lang:masterfrom
Urgau:unreach_pub-std

Conversation

@Urgau
Copy link
Member

@Urgau Urgau commented Dec 13, 2024

This PR enables the unreachable_pub as warn in core, rtstartup and panic_unwind.

The motivation is similar to the compiler MCP: Enable deny(unreachable_pub) on rustc_* crates :

"Where is this thing used?" is a question I ask all the time when reading unfamiliar code. Because of this, I generally find it annoying when things are marked with a more permissive visibility than necessary. "This thing marked pub, which other crates is it used in? Oh, it's not used in any other crates."

Another motivation is to help to lint by utilizing it in-tree and seeing it's limitation in more complex scenarios.

The diff was mostly generated with ./x.py fix --stage 1 library/core/ -- --broken-code, as well as manual edits for code in macros, generated code and other targets.

r? libs

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants