Skip to content

Rollup of 16 pull requests - #160549

Closed
jhpratt wants to merge 35 commits into
rust-lang:mainfrom
jhpratt:rollup-ukGDKn4
Closed

Rollup of 16 pull requests#160549
jhpratt wants to merge 35 commits into
rust-lang:mainfrom
jhpratt:rollup-ukGDKn4

Conversation

@jhpratt

@jhpratt jhpratt commented Aug 5, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

bjorn3 and others added 30 commits July 23, 2026 12:14
This will allow introducing a separate incr comp session dir for the
post LTO artifacts in the future. In addition it statically encodes the
lifetime of the incr comp session rather than requiring an enum behind a
mutex stored in the Session.
Pure file moves; the module path repointing and platform gating follow
in the next commit. Recorded in .git-blame-ignore-revs so blame skips
the rename.
Select the platform implementation with a cfg_select! in sys::sync::futex,
repoint each one at the pal primitives it uses (time, fuchsia, the windows
api module, hermit_abi), and remove the now-unused futex declarations from
the pal modules. The sync primitives import crate::sys::sync::futex rather
than the crate::sys::futex glob re-export.
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
…afe`

Also renames it to `rustc_specialization_ignore_lifetime_constraints`
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
Reword the `.expect(...)` messages in the TcpStream/TcpListener doc
examples in library/std/src/net/tcp.rs to follow the 'expect as
precondition' style from the std library guidance (describe why the
operation is expected to succeed, rather than restating the failure).

Examples:
  "set_nodelay call failed"   -> "set_nodelay should succeed"
  "could not set TTL"         -> "set_ttl should succeed"
  "Cannot set non-blocking"   -> "set_nonblocking should succeed"

Doc-only change, no behavior change.
Co-authored-by: Roland Xu <rcu@live.com>
also refactor check-miri a bit to make it easier to read
…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" />
move mir-opt miri tests to CI logic

It is useful to run Miri tests with mir-opts as that sometimes finds miscompilations.

However, doing so on every `./x test miri` is annoying as it makes that take a lot longer, and it is inconsistent with `./miri test` in the Miri repo. So remove this logic there, and instead have the check-miri script in CI invoke the test suite a 2nd time with mir-opts enabled.

Cc @rust-lang/miri
…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.
std: move futex implementations into sys::sync::futex

Part of rust-lang#117276.

Moves the futex primitives out of the per-platform `sys::pal` modules into a single `sys::sync::futex`, selected with `cfg_select!` the same way the other `sys::sync` backends are.
Every consumer of these primitives already lives in `sys::sync` (mutex, rwlock, once, condvar, thread_parking), so they now import `crate::sys::sync::futex` directly instead of reaching `crate::sys::futex` through the `pub use pal::*` glob.

I placed it under `sys::sync` rather than a top-level `sys::futex` because the futex API only backs the `sys::sync` primitives and sits next to the existing `sys::sync::thread_parking` backend.

Happy to place it to `sys::futex` if you would rather have it as a peer of the other feature modules.

The file moves are a separate commit, recorded in `.git-blame-ignore-revs` so blame skips the rename.

r? joboet
…oli-obk

Split IncrCompSession out of Session

This will allow introducing a separate incr comp session dir for the post LTO artifacts in the future. In addition it statically encodes the lifetime of the incr comp session rather than requiring an enum behind a mutex stored in the Session.

Based on rust-lang#159000
Part of rust-lang/compiler-team#908
…athanBrouwer

Make the `rustc_unsafe_specialization_marker` attribute actually `unsafe`

Also renames it to `rustc_specialization_marker`.

The "some internal attributes should probably be unsafe" discussion came up in [#t-compiler/major changes > Implement a naming convention for lint/d… compiler-team#1021](https://rust-lang.zulipchat.com/#narrow/channel/233931-t-compiler.2Fmajor-changes/topic/Implement.20a.20naming.20convention.20for.20lint.2Fd.E2.80.A6.20compiler-team.231021/with/612510054). This is one of those attributes.

cc @RalfJung
…-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.
@rustbot rustbot added 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-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool F-autodiff `#![feature(autodiff)]` O-hermit Operating System: Hermit O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library 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
@jhpratt

jhpratt commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

@bors r+ p=5

@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 c09ebd7 has been approved by jhpratt

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 16 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-*
@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: f7fd4a1 (f7fd4a1342602a8d8d8f067848e37ca32e09e813)
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-CI Area: Our Github Actions CI 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-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool F-autodiff `#![feature(autodiff)]` O-hermit Operating System: Hermit O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library 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.