Skip to content

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 13, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@ibraheemdev
Copy link
Member

This seems reasonable to me, does it need libs signoff?

@Urgau
Copy link
Member Author

Urgau commented Dec 27, 2024

I don't know T-libs customs around enabling new lints. Given that T-compiler as done an MCP I guess it doesn't hurt to at least nominate it.

@rustbot labels -S-waiting-on-review +S-waiting-on-team +I-libs-nominated

@rustbot rustbot added I-libs-nominated Nominated for discussion during a libs team meeting. S-waiting-on-team DEPRECATED: Use the team-based variants `S-waiting-on-t-lang`, `S-waiting-on-t-compiler`, ... and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 27, 2024
@bors

This comment was marked as resolved.

@bors

This comment was marked as resolved.

@Amanieu
Copy link
Member

Amanieu commented Jan 15, 2025

We discussed this in the libs meeting today, overall several people were in favor of enabling the lint and nobody objected.

@Amanieu Amanieu added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed I-libs-nominated Nominated for discussion during a libs team meeting. S-waiting-on-team DEPRECATED: Use the team-based variants `S-waiting-on-t-lang`, `S-waiting-on-t-compiler`, ... labels Jan 15, 2025
@ibraheemdev
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 16, 2025

📌 Commit 2fa6dbc has been approved by ibraheemdev

It is now in the queue for this repository.

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 21, 2025
@bors bors merged commit a42d5ec into rust-lang:master Jan 21, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 21, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a42d5ec): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary -2.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 764.999s -> 765.476s (0.06%)
Artifact size: 326.01 MiB -> 326.00 MiB (-0.00%)

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