Skip to content

Conversation

@clarfonthey
Copy link
Contributor

@clarfonthey clarfonthey commented Dec 18, 2025

In #669, a method marked pub had to be changed to pub(crate) in order to satisfy MSRV. Essentially, MSRV is not smart enough to determine that a method marked pub which is actually inaccessible outside the crate is not leaking private types, and so, we need to fix this.

I decided to automatically fix all instances of the unreachable_pub lint since, although MSRV does not have this lint, it could benefit from this change in the future, and it's better to make the changes now than have to sprinkle them occasionally later. I also see no need to permanently try and catch the lint in CI, since this is only a theoretically useful change. (Also, it has a few false positives, like changing Bucket to pub(crate) not being allowed due to being present in public trait implementations, despite the type itself not being public.)

@Amanieu
Copy link
Member

Amanieu commented Dec 21, 2025

I would prefer if we did actually enable unreachable_pub by default so we avoid introducing incorrect new uses of pub in the future. We can manually #[allow] the few places that need it due to false positives.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants