Skip to content

privacy: Fix type privacy holes in RPITITs#152543

Open
petrochenkov wants to merge 1 commit intorust-lang:mainfrom
petrochenkov:rprivtit2
Open

privacy: Fix type privacy holes in RPITITs#152543
petrochenkov wants to merge 1 commit intorust-lang:mainfrom
petrochenkov:rprivtit2

Conversation

@petrochenkov
Copy link
Contributor

@petrochenkov petrochenkov commented Feb 12, 2026

View all comments

A subset of #146470.

Private types in RPITITs now report hard errors.
Private types in bounds of associated types still only report the private_bounds lint due to unacceptable amount of breakage (#146470 (comment)).

Closes #144139

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 12, 2026
@petrochenkov
Copy link
Contributor Author

@bors try

rust-bors bot pushed a commit that referenced this pull request Feb 12, 2026
privacy: Fix type privacy holes when it doesn't cause too much breakage
@rust-bors

This comment has been minimized.

@petrochenkov
Copy link
Contributor Author

TODO: @craterbot check p=1 crates=https://crater-reports.s3.amazonaws.com/pr-146470-3/retry-regressed-list.txt

@petrochenkov petrochenkov marked this pull request as ready for review February 12, 2026 15:38
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 12, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 12, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 12, 2026

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 68 candidates
  • Random selection from 16 candidates

@petrochenkov petrochenkov added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 12, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 12, 2026

☀️ Try build successful (CI)
Build commit: fcfb0ff (fcfb0ffc7ed7fc631df1136063939ef648434735, parent: 7ad4e69ad585d8ff214f7b42d01f1959eda08f40)

@petrochenkov
Copy link
Contributor Author

@craterbot
Copy link
Collaborator

👌 Experiment pr-152543 created and queued.
🤖 Automatically detected try build fcfb0ff
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🚧 Experiment pr-152543 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@traviscross traviscross added the I-lang-radar Items that are on lang's radar and will need eventual work or consideration. label Feb 12, 2026
@craterbot
Copy link
Collaborator

🎉 Experiment pr-152543 is completed!
📊 27 regressed and 0 fixed (5514 total)
📊 267 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-152543/retry-regressed-list.txt

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Feb 12, 2026
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 13, 2026
@petrochenkov
Copy link
Contributor Author

Crater results are basically the same as #146470 without the second commit (see e.g. #146470 (comment)).

@petrochenkov
Copy link
Contributor Author

Previous FCP - #146470 (comment).

@petrochenkov petrochenkov added T-lang Relevant to the language team and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 13, 2026
@rust-rfcbot
Copy link
Collaborator

rust-rfcbot commented Mar 11, 2026

Team member @traviscross 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.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot 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 Mar 11, 2026
@scottmcm
Copy link
Member

scottmcm commented Mar 11, 2026

Making RPITIT match the RPIT behaviour makes sense to me.

(TBH it's not obvious to me that private bounds on an associated type are even a "problem" that we'd need to fix, but now that this isn't changing that, sure, happy to make it consistent in function return position. Especially if the public trait is sealed, having various non-public bounds on things doesn't seem unreasonable.)

@rfcbot reviewed

@traviscross traviscross removed I-lang-nominated Nominated for discussion during a lang team meeting. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang labels Mar 11, 2026
@tmandry
Copy link
Member

tmandry commented Mar 11, 2026

Agreed with @scottmcm. I'm happy to make things more consistent and save space for another model in the future. Not sure we'll need this restriction in the long run.

@rfcbot reviewed

@rust-rfcbot rust-rfcbot 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 Mar 11, 2026
@rust-rfcbot
Copy link
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Mar 11, 2026

Soooooo I still feel like I am missing a mental model for what we are attempting to achieve with our rules around privacy and private traits. It makes all of these changes feel kind of random to me. That said, I think we previously decided to move forward here, and this seems consistent with that, and RPITIT/RPIT consistency is good, and it seems like this will give us room to make more decisions in the future, so....

@rfcbot reviewed

@rust-rfcbot rust-rfcbot 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 Mar 21, 2026
@rust-rfcbot
Copy link
Collaborator

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.

@fmease fmease added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-t-lang Status: Awaiting decision from T-lang labels Mar 22, 2026
@fmease fmease changed the title privacy: Fix type privacy holes when it doesn't cause too much breakage privacy: Fix type privacy holes in RPITITs Mar 22, 2026
Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR leads to quite a few breakages but it seems too tricky and arduous to send downstream patches, unfortunately. @bors r+

View changes since this review

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 22, 2026

📌 Commit ef8c95c has been approved by fmease

It is now in the queue for this repository.

@rust-bors rust-bors bot 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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 22, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 22, 2026
privacy: Fix type privacy holes in RPITITs

A subset of rust-lang#146470.

Private types in RPITITs now report hard errors.
Private types in bounds of associated types still only report the `private_bounds` lint due to unacceptable amount of breakage (rust-lang#146470 (comment)).

Closes rust-lang#144139
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 22, 2026
privacy: Fix type privacy holes in RPITITs

A subset of rust-lang#146470.

Private types in RPITITs now report hard errors.
Private types in bounds of associated types still only report the `private_bounds` lint due to unacceptable amount of breakage (rust-lang#146470 (comment)).

Closes rust-lang#144139
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 22, 2026
privacy: Fix type privacy holes in RPITITs

A subset of rust-lang#146470.

Private types in RPITITs now report hard errors.
Private types in bounds of associated types still only report the `private_bounds` lint due to unacceptable amount of breakage (rust-lang#146470 (comment)).

Closes rust-lang#144139
rust-bors bot pushed a commit that referenced this pull request Mar 23, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #122668 (Add APIs for dealing with titlecase)
 - #152543 (privacy: Fix type privacy holes in RPITITs)
 - #153107 (Optimize BTreeMap::append() using CursorMut)
 - #153312 (Packages as namespaces part 1)
 - #153534 (Remove a flaky `got_timeout` assert from two channel tests)
 - #153718 (Fix environ on FreeBSD with cdylib targets that use -Wl,--no-undefined .)
 - #153857 (Rename `target.abi` to `target.cfg_abi` and enum-ify llvm_abiname)
 - #153880 (Lifted intersperse and intersperse_with Fused transformation and updated documentation + tests)
 - #153931 (remove usages of to-be-deprecated numeric constants)
 - #150630 (Unknown -> Unsupported compression algorithm)
 - #153491 (Move `freeze_*` methods to `OpenOptionsExt2`)
 - #153582 (Simplify find_attr! for HirId usage)
 - #153623 (std: move `sys::pal::os` to `sys::paths`)
 - #153647 (docs(fs): Clarify That File::lock Coordinates Across Processes)
 - #153936 (Skip stack_start_aligned for immediate-abort)
 - #154011 (implement `BinaryHeap::as_mut_slice`)
 - #154167 (ui/lto: move and rename two tests from issues/)
 - #154174 (allow `incomplete_features` in most UI tests)
 - #154175 (Add new alias for Guillaume Gomez email address)
 - #154182 (diagnostics: avoid ICE for undeclared generic parameter in impl)
 - #154188 (Update the tracking issue for #[diagnostic::on_move])
 - #154201 (Use enums to clarify `DepNodeColorMap` color marking )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team to-announce Announce this issue on triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(re-)Fix private-in-public for RPITIT

9 participants