

privacy: Stabilize lint `unnameable_types` by petrochenkov · Pull Request #12014...
source link: https://github.com/rust-lang/rust/pull/120144
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

privacy: Stabilize lint unnameable_types
#120144
Conversation
Contributor
This is the last piece of "RFC #2145: Type privacy and private-in-public lints".
Having unstable lints is not very useful because you cannot even dogfood them in the compiler/stdlib in this case (#113284).
The worst thing that may happen when a lint is removed are some removed_lints
warnings, but I haven't heard anyone suggesting removing this specific lint.
This lint is allow-by-default and is supposed to be enabled explicitly.
Some false positives are expected, because sometimes unnameable types are a legitimate pattern.
This lint also have some unnecessary false positives, that can be fixed - see #120146 and #120149.
Closes #48054.
Collaborator
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
labels
added T-lang Relevant to the language team, which will review and decide on the PR/issue. S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). I-lang-nominated The issue / PR has been nominated for discussion during a lang team meeting.
and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
labels
Contributor
Author
cc @Bryanskiy |
Implementation looks good to me, r=me after relevant sign-offs.
removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label
Member
We talked about this in today's @rust-lang/lang meeting. We're in favor of shipping this. Some of us were favorable towards making it warn-by-default in the future. We had one suggestion for naming and application of this lint: if we fired the lint specifically at the point where you are applying a non-pub visibility to a module with pub items, and called the lint something like |
Member
We discussed this in the lang triage meeting today. There was lots of discussion about the exact details of the lint, but general agreement that as allow-by-default we should let people start trying this so that they can give feedback about what it reports and how. @rfcbot fcp merge Some of the topics that came up were about potentially linting on the module that "hides" the things inside it instead of on the items hidden, what the right way to suppress this when needed would be, and why macros might be generating things as But as far as I could tell, none of those seemed like blockers for this PR making the lint available to people, just that people might potentially have concerns should a future PR propose moving it to warn-by-default, depending on details. |
Team member @scottmcm has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it.
labels
Member
I do think we should consider renaming this to |
Contributor
@rustbot labels -I-lang-nominated As evidenced by the discussion above, we discussed this on the lang call today, and while there was discussion about where to go from here, no one seemed opposed to stabilizing an allow-by-default lint. The outcome is the proposed FCP merge, so we can unnominate this. Thanks to @petrochenkov for pushing this forward. |
removed the I-lang-nominated The issue / PR has been nominated for discussion during a lang team meeting. label
Contributor
Author
What you are describing here looks like another already existing allow-by-default lint -
|
Member
@petrochenkov It sounds like you are using a definition of "reachable" that is different from what I understood the term to mean (which is the same as how you are using "nameable"). Explaining the terms in error messages and docs would help. My feeling is that we should just redefine |
Implementation looks good to me, r=me once lang discussions resolved.
This comment was marked as resolved.
Contributor
Author
I used the naming used in the compiler (
|
Contributor
Author
So, summarizing again:
|
Contributor
Author
I've updated some lint docs. |
added I-lang-nominated The issue / PR has been nominated for discussion during a lang team meeting.
and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
labels
added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised.
and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
labels
🔔 This is now entering its final comment period, as per the review above. 🔔 |
removed the I-lang-nominated The issue / PR has been nominated for discussion during a lang team meeting. label
added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting
and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised.
labels
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
Member
Already reviewed the implementation and the FCP has finished, so will approve this now. @bors r+ |
added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label).
labels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Successfully merging this pull request may close these issues.
Tracking issue for RFC #2145: Type privacy and private-in-public lints
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK