Skip to content

Rollup of 20 pull requests - #167071

Open
JonathanBrouwer wants to merge 90 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-rxJvN1M
Open

JonathanBrouwer wants to merge 90 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-rxJvN1M

Conversation

sgasho and others added 30 commits November 14, 2026 04:20
`check_fn_or_method` already normalizes each parameter and the return
type individually with its own span and `WellFormedLoc`. Re-normalizing
the entire signature in `check_method_receiver` under `param_idx = 0`
misattributes return-type obligations to the receiver and duplicates
work since only `sig.inputs()[0]` is used and normalized right after.
Passing `DUMMY_SP` to `wfcx.normalize` relies on
`diagnostic_hir_wf_check` to recover a span, which only runs for
unimplemented selection errors. Ambiguous obligations keep `DUMMY_SP`,
propagating it into fresh const inference variable origins and tripping
a debug assertion in `extract_inference_diagnostics_data`.

Pass the already-available receiver span instead and drop the unused
`DUMMY_SP` import.
This updates the rust-version file to 0d33ea9.
libc test utils: introduce macro to check for raw_os_error
use shared helpers instead of last_os_error
This updates the rust-version file to 16311ef.
also to trigger re-generating the cache, since GH seems to have broken our old cache
fix F_GETFL to return more of the flags
This updates the rust-version file to 82fc181.
_NSGetExecutablePath: use non-deprecated alternative
Add direct tests for `GetCommandLineW` and `GetModuleFileNameW`
…=chenyukang

Remove boilerplate around internal syntax parsing

We did have helpers for parsing `builtin_syntax` (`builtin # $ident($($tt)*)`) but when migrating to the `k#` approach I originally didn't introduce similar helpers since I didn't think it was worth it / didn't want to "force a framework". Due to the constant influx of new internal syntax however, I've changed my mind.

Part of rust-lang#110680.

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
…-args, r=ZuseZ4

Offload: handle ABI-ignored arguments in kernel lowering

`codegen_offload` built `metadata` and `types` from every ABI argument, including the ones with `PassMode::Ignore`. An ignored argument reaches the kernel as nothing, so it has no metadata entry, but the arrays gained one with no value to match it. `get_args_from_tuple` had the other half: it advanced a manual tuple field counter in three of its four arms and not for `Ignore`, so every argument after the ignored one read the previous argument's field.

- Skip `PassMode::Ignore` when building `metadata` and `types`, so `()` no longer occupies slots in the device mapping.
- Use the actual tuple index from `enumerate()` instead of a manual counter, because for these arguments the ABI index is the tuple field index.
- Assert that `args`, `types` and `metadata` have the same length with `assert_eq!`, not `debug_assert_eq!`, so it runs in release too. A mismatch already panics with a bare out-of-bounds message; the assertion names `get_args_from_tuple` and `handle_abi` instead.

The autodiff test marks the ignored unit `Const`, because no derivative is computed with respect to it. In the GPU test the slice is now shared rather than `&mut`, as @ZuseZ4 asked in review. The test reads through it and has no reason to require a mutable reference.

### Testing

Before the fix, `(u32, (), u32)` panicked with `index out of bounds: the len is 2 but the index is 2`, and autodiff got `Cannot cast __enzyme_autodiff primal argument ... found {} poison`. Both autodiff tests in this PR fail on the pre-fix compiler and pass on the fixed one; the GPU test fails with the same out-of-bounds panic at its own arity.

On x86_64-unknown-linux-gnu with an LLVM 23 built with `llvm.offload` and `llvm.enzyme`: `tests/codegen-llvm/autodiff` passes 16 of 16, `tests/codegen-llvm/gpu_offload` passes 9 of 11. The autodiff tests are gated on `needs-enzyme` and the offload ones on `needs-offload`, so CI runs each only where the LLVM was built with that backend. The two failures are `gpu_host.rs` and `slice_device.rs#amdgpu`, which still expect the descriptor and signature from before `be988e9f856`, `039b8bcadc7` and `c321d90e6fc`, and fail the same way without this change.

I tested on macOS (without execution) and on Linux with AMD for offload execution, including 400 fuzzed cases combining `()`, `((), ())`, `u*`, `&u32` and random lists of length 1-6. A separate run on a struct argument surfaced `offload does not support Struct`, identical on unpatched nightly, so I kept that pre-existing limitation out of this PR.

### LLM disclosure

I found the issue by testing the pass modes. AI made the tests and the fuzzer. I proposed the cases, and then I ran them and saw the results.

Related to rust-lang#131513

r? @ZuseZ4
…xt-parent, r=petrochenkov

Always hash syntax context's parent

Follow up for rust-lang#166636, we did not hash parent there mainly for performance reasons, but if it does not affect perf (locally on several benchmarks there were no significant changes) then it is better to always hash it.

r? @petrochenkov
…=JonathanBrouwer

remove AllowListWarnRest completely

Removed `AllowListWarnRest` completely, Added Warnings inside `AllowList` for diagnostic Attributes and removed the `Error(Target)` variant in `Policy` Enum.

r? @JonathanBrouwer
…jieyouxu

Notify T-compiler-ops of relevant triagebot.toml changes

In rust-lang#164879 it was almost approved a change in the `triagebot.toml` that would have wreaked havoc in my workflow, if Mark hadn't mentioned me.

I would like to be notified of relevant changes in this file, but how?

The easiest way would be create a `T-compiler-ops` label, autolabel changes to this file (99% of which are not for me interesting...) and subscribe issues with that label. Is there a better way?

r? @jieyouxu (what do you think?)

thanks
… r=JonathanBrouwer

Move `check_linkage` into the attribute parser

Implement part of rust-lang#153101.

Move the checks that reject `#[linkage]` on `extern` `static mut` items and `const fn` items from `check_attr` into `LinkageParser::finalize_check` in `rustc_attr_parsing`, using `AstTarget::ForeignStatic` and `AstTarget::Fn`. Move the `StaticMutLinkage` and `ConstFnLinkage` diagnostics accordingly.

Update the stale `check_attr` comments in `LinkageParser::ALLOWED_TARGETS` and `rustc_codegen_ssa`.

r? @JonathanBrouwer
float semantics docs: discuss subnormals and status flags

Also add sqrt to the list of primitive float operations, as that's how IEEE treats it and we [already](https://doc.rust-lang.org/nightly/std/primitive.f32.html#method.sqrt) make rounding guarantees for it.

Cc @tgross35 @Amanieu  @rust-lang/opsem
Move Mutex::into_inner method to Sized impl block

The `into_inner` method of `std::sync::Mutex` (and `std::sync::nonpoison::Mutex`) was located in the second `impl` block with `T: ?Sized` (and had a `where T: Sized` bound).
I simply moved it to the first `impl` block where `T` already had a `Sized` bound.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Dec 4, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-box Area: Our favorite opsem complication 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-num Area: `core::num::*` and `std::num::*`, numeric traits and functions for the built-in numeric types A-rc Area: `Rc` and `Arc` A-run-make Area: port run-make Makefiles to rmake.rs A-thread Area: `std::thread` PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang-docs Relevant to the lang-docs team. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Dec 4, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

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

@rust-bors

rust-bors Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🌟 Commit ca1ab8b has been approved by JonathanBrouwer

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 Dec 4, 2026
@rust-bors

rust-bors Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Trying commit ca1ab8b with merge 3c6c31f…

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

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

rust-bors Bot pushed a commit that referenced this pull request Dec 4, 2026
Rollup of 20 pull requests


try-job: dist-various-1
try-job: dist-various-2
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-msvc-1
try-job: test-aarch64-apple-1
try-job: test-aarch64-apple-2
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
try-job: test-x86_64-gnu-llvm-22-3
try-job: test-aarch64-msvc-2

This branch has not been deployed

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-box Area: Our favorite opsem complication 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-num Area: `core::num::*` and `std::num::*`, numeric traits and functions for the built-in numeric types A-rc Area: `Rc` and `Arc` A-run-make Area: port run-make Makefiles to rmake.rs A-thread Area: `std::thread` PG-exploit-mitigations Project group: Exploit mitigations 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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang-docs Relevant to the lang-docs team. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.