Skip to content

Rollup of 20 pull requests - #162317

Open
Zalathar wants to merge 60 commits into
rust-lang:mainfrom
Zalathar:rollup-TJS7wv1
Open

Rollup of 20 pull requests#162317
Zalathar wants to merge 60 commits into
rust-lang:mainfrom
Zalathar:rollup-TJS7wv1

Conversation

@Zalathar

@Zalathar Zalathar commented Sep 5, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Dnreikronos and others added 30 commits August 11, 2026 15:21
Store identity argument indices instead of bound generic arguments so
callers can index concrete alias arguments without changing rigidness
through instantiation.
Match the existing params_in_repr / unsizing_params convention;
the compiler already treats generic arg counts as u32-sized.
Treat missing outlives information as no restriction so all sources can be
intersected uniformly. Keep bivariant alias arguments out of the final region
walk.
This is mainly because it would be very useful in Clippy to have a fast
way to check if two DefIds are related (and what that relation is).
This attempts to match clang's behavior of implicitly disabling
sanitizers that are incompatible. Specifically, if a set of default
sanitizers would be incompatible with ones provided by -Zsanitize=...,
then clang (and now rust) will opt for keeping the ones specified via
flags over the ones used as platform defaults. This helps maintain build
consistency where we can just enable sanitizers via flags for both rust and
c++ code without needing to manually disable others.

The driving reason for this is asan and safestack where we'd like to
enable safestack by default for x86_64 fuchsia but disable it if
-Zsanitize=address is passed (matching clang's behavior).

This commit also refactors all uses of `self.opts.unstable_opts.sanitizer`
to go through the updated `sanitizer()` method.

AI: Gemini was used to help review the code and write some tests, but it
did not generate the whole patch. I edited and reviewed this PR to the
best of my ability before pushing for review.
This patch introduces the following:

* Extends `FnAbi` (`callconv`) with a `ptrauth_type_discriminator`
  field. This field is only used when emitting pointer authentication
  call bundles. It is stored in `FnAbi` because the call site is not
  guaranteed to have access to an `Instance`, so the discriminator
  cannot always be computed on demand.
* Adds support for `llvm.ptrauth.resign`. This intrinsic will be used
  when support for semantic transmute is added.
* Performs a minor API redesign as groundwork for allowing call sites to
  modify schemas in place.
This commit updates documentation, configuration, etc, within the
compiler to promote the `wasm32-wasip3` target to tier 2. This means
that precompiled binaries will be made available in `rustup` for usage.
This target MCP for this change is [rust-lang/compiler-team/100][mcp].

This target requires LLVM 23 which rustc recently has updated to, and
then additionally requires wasi-sdk-34 which additionally uses LLVM 23
which was also updated recently. With these ingredients in place the ABI
for `wasm32-wasip3` is all lined up and ready to go. These changes were
all necessary to bring cooperative threading to the target in the
future, but that's not quite ready in the ecosystem yet.

I've locally been testing this target and it's done well so far, but I
suspect this'll need subsequent bug fixes here and there as other new
issues crop up. I don't expect anything major will be necessary,
however.

[mcp]: rust-lang/compiler-team#1001
`Cargo::cargo` adds LLVM's library search path to `rustflags` for
`ToolRustcPrivate`/`Codegen` so that tools linking against compiler
libraries can find `libLLVM`. However, it always queried
`host_llvm_config()`, which resolves to the *host*'s `llvm-config`
regardless of the requested `target`. When cross-compiling, this
appends the host's LLVM libdir to the target's link flags, which can
cause linking to fail.

Only use `llvm-config --libdir` when `target` is the host. Otherwise,
ensure the `Llvm` step for `target` and derive the libdir from its
`root_dir()` instead of invoking `llvm-config`, since the resulting
binary may not be executable on the host if it was built for a
different target.
These tests are of limited value for investigating specific problems, but still
have some worth in detecting regressions by adding variety to the test corpus.

(The boundary is a bit fuzzy, but it's easy enough to move tests back out if
appropriate.)
This small utility provides a familiar key-value view of an `IndexMap`
in the debugging output.

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>

Signed-off-by: Xiangfei Ding <dingxiangfei2009@protonmail.ch>
Also blesses existing tests to make way for sve asm support
Facilitates scalable vector support in inline assembly.
Adds new `zreg` register type and `SveVec*` variants to `InlineAsmType`
…unit, r=davidtwco

fix `is_homogeneous_aggregate`: use unit size, not total size

fixes rust-lang#161382

The vector case of the three (arm, aarch64, powerpc64) `is_homogeneous_aggregate` implementations looked at the total type size, instead of the unit size.

blocked on rust-lang#161070 merging

r? davidtwco
coverage: Tidy tests and add some new ones

While experimenting with some coverage changes, I noticed that some of our tests are not very useful for diagnosing problems, and that we lack good simple tests for some common Rust constructs.
…re-ref-fn-kind-diagnostic, r=davidtwco

Improve diagnostics for references to closures

Fixes rust-lang#161327
When passing a reference to a closure that fails an `Fn*` bound (e.g. `&mut c` where `c` is an `FnMut` closure passed to a function expecting `impl Fn`, or an `FnOnce` closure passed where `FnMut` is expected), rustc currently suggests removing the leading `&`. If the underlying closure doesn't implement the required trait in the first place, that suggestion is misleading because removing the reference still won't make it satisfy the bound.
This PR makes `emit_specialized_closure_kind_error` peel references to closures so we can emit E0525 and point out the mutation/move that caused the mismatch. Since closure kind inference hasn't run yet when checking the call arguments, we run a quick capture pass on-demand to figure out the actual closure kind.
To be conservative:
- We bail out to E0277 if there are nested closures in the body (since we don't know their captures yet).
- We bail out to E0277 if a by-value capture has an unresolved type variable (like `{integer}`) that might turn out to be `Copy` after fallback.
- If the closure actually satisfies the expected trait (e.g. a genuine `Fn` closure wrapped in `&mut` passed to `Fn`), `found_kind.extends(expected_kind)` holds, so we keep E0277 and the valid remove-ref suggestion.
…st-mut-fnmut-reference, r=davidtwco

Suggest mutable references for FnMut closure arguments

Fixes rust-lang#118843
…r=jieyouxu

Add more splat fn type tests

Tracking issue: rust-lang#153629

This PR turns some rustfmt splat tests from rust-lang/rustfmt#7032 into rustc UI tests. It is a test-only PR.

These tests check _invalid_ function pointer / function type splatting, which has had recent ICE fixes (rust-lang#158603, rust-lang#159643).

The `rustfmt::skip` is required until rust-lang#161709 reaches stable.
…blic, r=davidtwco

Make `tcx.def_id_partial_cmp` public

This is mainly because it would be very useful in Clippy to have a fast way to check if two DefIds are related (and what that relation is).

Related to Clippy performance.
…ble-sanitizers, r=davidtwco

sanitizers: Implicitly disable mutually exclusive sanitizers

This attempts to match clang's behavior of implicitly disabling sanitizers that are incompatible. Specifically, if a set of default sanitizers would be incompatible with ones provided by -Zsanitize=..., then clang (and now rust) will opt for keeping the ones specified via flags over the ones used as platform defaults. This helps maintain build consistency where we can just enable sanitizers via flags for both rust and c++ code without needing to manually disable others.

The driving reason for this is asan and safestack where we'd like to enable safestack by default for x86_64 fuchsia but disable it if -Zsanitize=address is passed (matching clang's behavior).

This commit also refactors all uses of `self.opts.unstable_opts.sanitizer` to go through the updated `sanitizer()` method.

AI: Gemini was used to help review the code and write some tests, but it did not generate the whole patch. I edited and reviewed this PR to the best of my ability before pushing for review.
…le_modules, r=davidtwco

add suggestion for `rustc_allowed_through_unstable_modules` attribute
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Sep 5, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` A-testsuite Area: The testsuite used to check the correctness of rustc O-SGX Target: SGX 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-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-rust-analyzer Relevant to the rust-analyzer 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 Sep 5, 2026
@Zalathar

Zalathar commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

Capping this rollup at 20 PRs as a compromise between throughput, failure chance, and triage difficulty.

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e0ced1e has been approved by Zalathar

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 Sep 5, 2026
@Zalathar

Zalathar commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

Trying various jobs in advance, including the one that failed in #162310 (comment)

@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,x86_64-mingw-1,i686-msvc-1,i686-msvc-2,dist-x86_64-apple

@rust-bors

rust-bors Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

⌛ Trying commit e0ced1e with merge b70c975

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/33942222136

rust-bors Bot pushed a commit that referenced this pull request Sep 5, 2026
Rollup of 20 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: x86_64-mingw-1
try-job: i686-msvc-1
try-job: i686-msvc-2
try-job: dist-x86_64-apple
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-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` A-testsuite Area: The testsuite used to check the correctness of rustc O-SGX Target: SGX rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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-rust-analyzer Relevant to the rust-analyzer 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.