Skip to content

std: make a lot of items crate private - #161612

Open
pacak wants to merge 1 commit into
rust-lang:mainfrom
pacak:unreachable-pub
Open

std: make a lot of items crate private#161612
pacak wants to merge 1 commit into
rust-lang:mainfrom
pacak:unreachable-pub

Conversation

@pacak

@pacak pacak commented Aug 23, 2026

Copy link
Copy Markdown
Contributor
  1. Enabled warn(unreachable_pub)
  2. Made a lot of things crate private, to the point when doing more required adding exceptions
  3. Removed warn(unreachable_pub)

So now this commit just tightens the current visibility without trying to enforce it.

View all comments

r? clarfonthey

@rustbot rustbot added the O-unix Operating system: Unix-like label Aug 23, 2026
@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 Aug 23, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@pacak
pacak force-pushed the unreachable-pub branch 2 times, most recently from af7af07 to a6a436d Compare August 23, 2026 18:59
@rustbot rustbot added the O-windows Operating system: Windows label Aug 23, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@clarfonthey

Copy link
Copy Markdown
Contributor

So, looking at this, I'm going to nominate this for discussion alongside the clippy lints PR: #161328

Since they should go together, I think.

@rustbot label:I-libs-nominated

@rustbot rustbot added the I-libs-nominated Nominated for discussion during a libs team meeting. label Aug 23, 2026
@pacak

pacak commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Sure.

Please no more obscure platform failures, please no more obscure platform failures, please no more obscure platform failures, please no more obscure platform failures...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) label Aug 23, 2026
Comment thread library/std/src/sys/pal/windows/c/windows_sys.rs
@pacak
pacak force-pushed the unreachable-pub branch 2 times, most recently from 69a1881 to 21fd14f Compare August 23, 2026 21:41
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot

rustbot commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Any special-casing of Miri in the standard library requires review.

cc @rust-lang/miri

@pacak

pacak commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Any special-casing of Miri in the standard library requires review.

Heh. I think at that point I'll just remove the warn and allow and leave as much correct visibility tightening as possible without adding exceptions.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@6-BennyLi-9

This comment was marked as off-topic.

@pacak
pacak force-pushed the unreachable-pub branch 2 times, most recently from 375d9f3 to 555957a Compare August 24, 2026 07:47
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@pacak pacak changed the title std: add warn(unreachable_pub) and clean up the fallout std: make a lot of items crate private Aug 24, 2026
@rust-bors

This comment has been minimized.

@pacak

pacak commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

☔ The latest upstream changes

I was afraid of this.

@rustbot

rustbot commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

Most of them don't need to be public, but there are scenarios where
thing is private on one platform but public on the other, so having a
lint on all the time gets complicated.

I enabled the lint, made a lot of things private to the point that
dealing with the rest required adding exceptions and disabled the lint
back again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-libs-nominated Nominated for discussion during a libs team meeting. O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) O-unix Operating system: Unix-like O-windows Operating system: Windows 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants