Skip to content

Privacy: small cleanups - #156673

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Bryanskiy:privacy_rtit
Jun 2, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Bryanskiy:privacy_rtit

Conversation

@Bryanskiy

@Bryanskiy Bryanskiy commented May 17, 2026 •

Copy link
Copy Markdown
Contributor

@rustbot rustbot 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 May 17, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 17, 2026
rust-bors Bot pushed a commit that referenced this pull request May 17, 2026
Privacy: fix effective visibility calculation for items reachable through RPIT
Comment thread compiler/rustc_privacy/src/lib.rs
@rust-bors

rust-bors Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: e9de5d9 (e9de5d9b70ebe43e1edce7a1ee56737608d099c3, parent: ba0949ab745985a442e274ba52e8fb348cb0c662)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (e9de5d9): comparison URL.

Overall result: ❌ regressions - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.5% [0.2%, 5.6%] 25
Regressions ❌
(secondary)
0.4% [0.2%, 1.3%] 21
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.2%, 5.6%] 25

Max RSS (memory usage)

Results (primary -3.7%, secondary -2.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.7% [-4.7%, -2.9%] 3
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) -3.7% [-4.7%, -2.9%] 3

Cycles

Results (primary 2.4%, secondary -0.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
4.8% [3.0%, 6.6%] 2
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
-2.5% [-2.5%, -2.5%] 1
Improvements ✅
(secondary)
-3.4% [-3.4%, -3.4%] 1
All ❌✅ (primary) 2.4% [-2.5%, 6.6%] 3

Binary size

Results (primary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.4%, 0.2%] 5

Bootstrap: 511.658s -> 511.881s (0.04%)
Artifact size: 398.51 MiB -> 400.43 MiB (0.48%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 17, 2026
@Bryanskiy

Bryanskiy commented May 18, 2026 •

Copy link
Copy Markdown
Contributor Author

The fix is too conservative. Even if there is no RPIT in the crate, it will mark private items as ReachableThroughImplTrait.

@petrochenkov

Copy link
Copy Markdown
Contributor

This needs an issue reproduction using impl Trait, but not involving associated type bounds, which are a known type privacy hole.
Otherwise it's not clear whether this change actually fixes anything.
@rustbot author

@rustbot rustbot 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 May 18, 2026
@rustbot

rustbot commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Jun 1, 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.

@Bryanskiy Bryanskiy changed the title Privacy: fix effective visibility calculation for items reachable through RPIT Privacy: small cleanups Jun 1, 2026
@Bryanskiy

Copy link
Copy Markdown
Contributor Author

This needs an issue reproduction using impl Trait, but not involving associated type bounds, which are a known type privacy hole. Otherwise it's not clear whether this change actually fixes anything. @rustbot author

I can't create example, so I left a comment along with other small cleanups

@Bryanskiy

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 1, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2744044 has been approved by petrochenkov

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 Jun 1, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 1, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 1, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #156085 (miri: require (almost) all 1-ZST arguments to be actually passed)
 - #155193 (Check arguments of attributes where no arguments are expected)
 - #156516 (nix: remove some unneeded variables)
 - #156562 (Resolving Windows environment test failures)
 - #156588 (Don't drop uninit memory when `MapWindows::clone` panics)
 - #156673 (Privacy: small cleanups)
 - #156817 (Add `#[unsafe_eii]` to unsafe EII UI tests)
 - #156924 (Use #[panic_handler] rather than #[lang = "panic_impl"])
 - #157055 (LLVM 23: Run AssignGUIDPass in some places)
 - #157108 (Add Xtensa va_arg assembly coverage)
 - #157220 (cg_ssa: a bit less `immediate_or_packed_pair`)
 - #157241 (Trace `?id.local_def_index` instead of `id` in `def_path_hash`)
 - #157242 (Tune backport Zulip messages)
rust-bors Bot pushed a commit that referenced this pull request Jun 1, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #156085 (miri: require (almost) all 1-ZST arguments to be actually passed)
 - #155193 (Check arguments of attributes where no arguments are expected)
 - #156516 (nix: remove some unneeded variables)
 - #156562 (Resolving Windows environment test failures)
 - #156588 (Don't drop uninit memory when `MapWindows::clone` panics)
 - #156673 (Privacy: small cleanups)
 - #156817 (Add `#[unsafe_eii]` to unsafe EII UI tests)
 - #156924 (Use #[panic_handler] rather than #[lang = "panic_impl"])
 - #157055 (LLVM 23: Run AssignGUIDPass in some places)
 - #157108 (Add Xtensa va_arg assembly coverage)
 - #157220 (cg_ssa: a bit less `immediate_or_packed_pair`)
 - #157241 (Trace `?id.local_def_index` instead of `id` in `def_path_hash`)
 - #157242 (Tune backport Zulip messages)
rust-bors Bot pushed a commit that referenced this pull request Jun 1, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #156085 (miri: require (almost) all 1-ZST arguments to be actually passed)
 - #155193 (Check arguments of attributes where no arguments are expected)
 - #156516 (nix: remove some unneeded variables)
 - #156562 (Resolving Windows environment test failures)
 - #156588 (Don't drop uninit memory when `MapWindows::clone` panics)
 - #156673 (Privacy: small cleanups)
 - #156817 (Add `#[unsafe_eii]` to unsafe EII UI tests)
 - #156924 (Use #[panic_handler] rather than #[lang = "panic_impl"])
 - #157055 (LLVM 23: Run AssignGUIDPass in some places)
 - #157108 (Add Xtensa va_arg assembly coverage)
 - #157220 (cg_ssa: a bit less `immediate_or_packed_pair`)
 - #157241 (Trace `?id.local_def_index` instead of `id` in `def_path_hash`)
 - #157242 (Tune backport Zulip messages)
@rust-bors
rust-bors Bot merged commit 35e1dc0 into rust-lang:main Jun 2, 2026
12 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 2, 2026
rust-timer added a commit that referenced this pull request Jun 2, 2026
Rollup merge of #156673 - Bryanskiy:privacy_rtit, r=petrochenkov

Privacy: small cleanups

r? @petrochenkov
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Jun 2, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#156085 (miri: require (almost) all 1-ZST arguments to be actually passed)
 - rust-lang/rust#155193 (Check arguments of attributes where no arguments are expected)
 - rust-lang/rust#156516 (nix: remove some unneeded variables)
 - rust-lang/rust#156562 (Resolving Windows environment test failures)
 - rust-lang/rust#156588 (Don't drop uninit memory when `MapWindows::clone` panics)
 - rust-lang/rust#156673 (Privacy: small cleanups)
 - rust-lang/rust#156817 (Add `#[unsafe_eii]` to unsafe EII UI tests)
 - rust-lang/rust#156924 (Use #[panic_handler] rather than #[lang = "panic_impl"])
 - rust-lang/rust#157055 (LLVM 23: Run AssignGUIDPass in some places)
 - rust-lang/rust#157108 (Add Xtensa va_arg assembly coverage)
 - rust-lang/rust#157220 (cg_ssa: a bit less `immediate_or_packed_pair`)
 - rust-lang/rust#157241 (Trace `?id.local_def_index` instead of `id` in `def_path_hash`)
 - rust-lang/rust#157242 (Tune backport Zulip messages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants