Skip to content

Rollup of 11 pull requests - #160547

Closed
JonathanBrouwer wants to merge 24 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-l4vRX97
Closed

Rollup of 11 pull requests#160547
JonathanBrouwer wants to merge 24 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-l4vRX97

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

xmakro and others added 24 commits July 29, 2026 09:00
Use codegen tail discovery so wrappers such as OsStr keep slice element
metadata without losing offsets for prefixed DSTs. Keep recursion tracking
scoped to the current traversal path.
`rustc_privacy` pulls in all of `rustc_ty_utils`, but only wants
`SpannedTypeVisitor` and `walk_types`. Move those to a small
`rustc_ty_walk` crate.

This allows `rustc_privacy` to start building much sooner.
…which does tracked and untracked borrowing
There is a `impl PpAnn for TyCtxt`  that is unneeded. None of the big crates (middle, trait_selection) actually do any hir pretty printing so it can be removed and can either be implemented for local structs elsewhere or done by casting to `&dyn PpAnn` instead.
Clarify that slice-tail layout checks apply to the sized prefix rather
than the slice element, and cover zero-sized slice elements in the
type-tree run-make test.
Fixes a small typo in the documentation comment for AllowExprMetavar. 
Changes decrarative to `declarative`.

Change in compiler/rustc_attr_parsing/src/parser.rs: Line 492
Co-authored-by: Roland Xu <rcu@live.com>
…y-sampling, r=cjgillot

Select cache values to verify by key fingerprint, not value fingerprint

rustc verifies ~1/32 of values loaded from the incremental cache by re-hashing them. The subset is selected by the value fingerprint, so it changes whenever a value changes and between any two compiler builds. That makes verification failures flaky to reproduce, and it moves the re-hashing cost around between the two builds rustc-perf compares, which is why rustc-perf forces `-Zincremental-verify-ich` on every benchmarked invocation.

This PR selects by the key fingerprint and the session count instead. Both are fixed for a given previous session, so re-running a failed build verifies the same nodes and a verification failure reproduces on retry. `to_smaller_hash` mixes both fingerprint halves because neither half is evenly distributed on its own: `DefPathHash` keys share the `StableCrateId`, `HirId` keys carry a sequential id.

The per-session sampling rate is unchanged at 1/32, and `-Zincremental-verify-ich` is unchanged. Coverage over time improves: the subset rotates with the session count and sweeps the entire cache every 32 sessions, while under value selection a node whose value never changed kept its roll forever, so 31/32 of unchanging values were never verified on a given toolchain.

Between two compiler builds the subset still differs, because key fingerprints incorporate the rustc version through `StableCrateId`. Pinning the version via `RUSTC_FORCE_RUSTC_VERSION` and `RUSTC_OVERRIDE_VERSION_STRING` makes corresponding sessions identical; session counts align because both builds run the same scenario sequence from a fresh incremental directory. That would let rustc-perf stop forcing full verification and measure the incremental configuration users actually run.

Coverage across compiler releases is unchanged: the version salt reshuffles the subset each release under either scheme, and compiletest forces full verification in all incremental tests.
Remove rustc_middle dependency on rustc_hir_pretty

There is a `impl PpAnn for TyCtxt`  that is unneeded. None of the big crates (middle, trait_selection) actually do any hir pretty printing so it can be removed and can either be implemented for local structs elsewhere or done by casting to `&dyn PpAnn` instead.

This probably doesn't have any perf effects (its not bottlenecking in timings) but I expect it to compose with rust-lang#160336 and its followup works quite well.

Old graph:
<img width="1999" height="2171" alt="graph" src="https://github.com/user-attachments/assets/756e6a50-a413-4a8d-a0f3-7bbf4de07933" />

New graph:
<img width="1853" height="2171" alt="graph_hir_pretty" src="https://github.com/user-attachments/assets/f9607e5a-d00b-4a86-8f6a-cefb45b75ad7" />
…rochenkov

Avoid resolving path keywords outside `TypeNS`

Fixes rust-lang#160195

After allowing trailing `self`, `self` imports were resolved in all namespaces wrongly. Resolving path keywords should return `Determined` immediately outside `TypeNS`.

r? petrochenkov
…ative-flag, r=petrochenkov

Resolver: (un)tracked borrows for `CmRefCell` made safe my unsafe speculative flag

Implements the tracked/untracked borrowing of `CmRefCell` such that we do not mutate *any* state during speculative resolution. Made safe by an unsafe field that requires any borrows to be dropped before the flag can change.

r? @petrochenkov
[blocked] Link to proposed LLM policy in CONTRIBUTING and pull request template

**Blocked** until rust-lang/rust-forge#1040 merges.

As described in rust-lang/blog.rust-lang.org#1897, this adds a checkbox for authors to confirm that they have/have not used an LLM. For that reason I would like to merge it *before* the blog post.
…-dead

Split `SpannedTypeVisitor` into its own crate, `rustc_ty_walk`

`rustc_privacy` pulls in all of `rustc_ty_utils`, but only wants `SpannedTypeVisitor` and `walk_types`. Move those to a small `rustc_ty_walk` crate.

This allows `rustc_privacy` to start building much sooner.
…etree, r=oli-obk

autodiff: Handle slice-tailed DSTs in type trees

Fixes rust-lang#160327

References to `OsStr` reach a `[u8]` tail, but autodiff only recognized direct slices. TypeTree generation then recursed into `OsStr` and hit the slice arm that ICEd.

TypeTree generation and ABI activity handling now use `struct_tail_for_codegen`. Slice wrappers keep their element metadata, while prefixed DSTs retain their field offsets. IMO, reusing the existing rustc DST-tail query is cleaner than adding an `OsStr` special case. BTW, coverage includes the reduced `clap_lex` reproducer plus a prefixed slice-tail DST.
…suggestion, r=mu001999

Suggest `cast_signed()` for overflowing signed integer literals

This PR uses `cast_signed()` for same-width conversions and keeps `as` for different-width conversions.

It also updates the affected UI test snapshots.

Fixes rust-lang#160403
…ikomatsakis

Add some tests for specialization

cc rust-lang#31844 (specialization tracking issue)

Closes rust-lang#32483 (fixed)
Closes rust-lang#48515 (fixed)
Closes rust-lang#52396 (fixed)
Closes rust-lang#74809 (fixed)
Closes rust-lang#77026 (fixed)
Closes rust-lang#80700 (fixed)
Closes rust-lang#126268 (dupe of rust-lang#102252)

cc. rust-lang#50318 (known-bug)
cc. rust-lang#36262 (known-bug, fixed-by-next-solver)
cc. rust-lang#125014 (known-bug, fixed-by-next-solver)

r? nikomatsakis

Disclosure: These issues are from Github, but I used an LLM to help copy them over. I reviewed all tests.
…s, r=jieyouxu

fix(bootstrap): Normalize the names of proc macro dependency crates

Fixes rust-lang#134863 (again)
rust-lang#134863 (comment)
…illa

docs: fix typo in AllowExprMetavar comment

Fixes a small typo in the documentation comment for AllowExprMetavar.  Changes decrarative to `declarative`.

Change in compiler/rustc_attr_parsing/src/parser.rs: Line 492
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Aug 5, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs labels Aug 5, 2026
@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend A-tidy Area: The tidy tool F-autodiff `#![feature(autodiff)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 5, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ p=5

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1,i686-msvc-*

@rust-bors

rust-bors Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit dad3424 has been approved by JonathanBrouwer

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 10. This pull request will be tested once the tree is reopened.

Reason for tree closure: manually handling queue due to backlog

@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 Aug 5, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 5, 2026
Rollup of 11 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple
try-job: x86_64-mingw-1
try-job: i686-msvc-*
@jhpratt

jhpratt commented Aug 5, 2026

Copy link
Copy Markdown
Member

superseding rollup: #160549

@jhpratt jhpratt closed this Aug 5, 2026
@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 5, 2026
@rust-bors

rust-bors Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@rust-bors

rust-bors Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 3377044 (33770444c5179e3b4aef34cb439820b82427e10c)
Base parent: 7218ebe (7218ebe93668f51a94a572b690c433dfdbdc2c3d)

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend A-tidy Area: The tidy tool F-autodiff `#![feature(autodiff)]` rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.