Commit Graph

320619 Commits

Author SHA1 Message Date
Guillaume Gomez e54a3d33ef Remove usage of TyCtxt::node_span_lint in clippy 2026-03-09 22:50:10 +01:00
Guillaume Gomez 4c48a5bf5f Remove usage of TyCtxt::node_span_lint in librustdoc 2026-03-09 18:07:12 +01:00
bors 3945997aab Auto merge of #153605 - JonathanBrouwer:rollup-p3xMXMQ, r=JonathanBrouwer
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#152847 (Test for armv7 `get_unchecked(...)` inlining)
 - rust-lang/rust#153290 (tests: codegen-llvm: iter-repeat-n-trivial-drop: Allow non-zero lower bound to __rust_alloc size)
 - rust-lang/rust#153413 (std: organise `sys::pal::os`)
 - rust-lang/rust#139692 (Rustfmt now support use closures)
 - rust-lang/rust#152800 (Adds recursion limit into FindParamInClause)
 - rust-lang/rust#153244 (tools: remote-test-server: Add UEFI run support)
 - rust-lang/rust#153305 (Adapt codegen test to accept operand bundles)
 - rust-lang/rust#153340 (tweak r-a default settings)
 - rust-lang/rust#153509 (Cleanup unused diagnostic emission methods - part 2)
 - rust-lang/rust#153527 (Fix LegacyKeyValueFormat report from docker build: ohos)
 - rust-lang/rust#153594 (Move some ui tests)
2026-03-09 12:38:16 +00:00
Jonathan Brouwer 2d9fde77a8 Rollup merge of #153594 - reddevilmidzy:ui-refactor, r=JohnTitor,Kivooeo
Move some ui tests

> [!NOTE]
> I split the commits to make the review easier and to keep the git history easier to trace.

Renamed issue-xxx tests

`tests/ui/dyn-drop` -> `tests/ui/dyn-keyword`
`tests/ui/missing-trait-bounds` -> `tests/ui/trait-bound/missing-trait-bounds`
`tests/ui/recursion_limit` -> `tests/ui/recursion/recursion_limit`
`tests/ui/version` -> `tests/ui/compile-flags`

Reorganize `tests/ui/empty`
2026-03-09 11:49:26 +01:00
Jonathan Brouwer 4ff5147f30 Rollup merge of #153527 - homersimpsons:chore/fix-LegacyKeyValueFormat-ohos, r=marcoieni
Fix LegacyKeyValueFormat report from docker build: ohos

Part of https://github.com/rust-lang/rust/pull/152305

r? @marcoieni
2026-03-09 11:49:26 +01:00
Jonathan Brouwer d4630f14eb Rollup merge of #153509 - GuillaumeGomez:migrate-diag2, r=JonathanBrouwer
Cleanup unused diagnostic emission methods - part 2

Part of https://github.com/rust-lang/rust/issues/153099.

r? @JonathanBrouwer
2026-03-09 11:49:25 +01:00
Jonathan Brouwer 3fdbbfbc84 Rollup merge of #153340 - WaffleLapkin:ra-settings-tweaks, r=Mark-Simulacrum
tweak r-a default settings

1. Explain that you need to make paths absolute in helix settings
2. Use the correct compiler (set `RUSTC` and `CARGO` to stage0, instead of `RUSTUP_TOOLCHAIN=nightly`)
3. Add comments to vscode and zed settings

NB: I only tested helix settings, but am pretty sure that the other changes shouldn't break anything.
2026-03-09 11:49:25 +01:00
Jonathan Brouwer 662798eb63 Rollup merge of #153305 - TimNN:bundle-assert, r=Mark-Simulacrum
Adapt codegen test to accept operand bundles

The updated test current fails when rustc is built with HEAD LLVM: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/44013/steps/canvas?sid=019cafec-3cca-44b2-aa9f-b41c0a940e8b

Likely as a result of https://github.com/llvm/llvm-project/pull/169923

Since the new codegen merges two lines into one, I couldn't figure out a way to make the test work on both LLVM versions without introducing revisions. (Though I could instead make the test run on only LLVM 23+).

@rustbot label llvm-main
2026-03-09 11:49:24 +01:00
Jonathan Brouwer 8b12e0a5c2 Rollup merge of #153244 - Ayush1325:uefi-run-test, r=Mark-Simulacrum
tools: remote-test-server: Add UEFI run support

Tested with OVMF on QEMU with Linux as the host running remote-test-client. The instructions for running tests are provided below:

1. Use rust-lld linker: `bootstrap.toml`

```toml
[rust]
lld = true

[target.x86_64-unknown-uefi]
linker = "rust-lld"
```

2. Use a custom startup.nsh script to auto-launch remote-test-server. This is optional.

```shell
fs1:
run.efi --sequential --bind "10.0.2.15:12345" --batch
```

3. Launch remote-test-server in QEMU. I am using uefi-run script [0].

```shell
uefi-run build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-uefi/release/remote-test-server.efi  -n --startup startup.nsh --tcp-port 12345
```

4. Run tests:

```shell
RUST_TEST_THREADS=1 TEST_DEVICE_ADDR="localhost:12345" ./x.py test tests/ui/abi --target x86_64-unknown-uefi --stage 1
```

Requires: https://github.com/rust-lang/rust/pull/151014
@rustbot label +O-UEFI
cc @nicholasbishop

[0]: https://github.com/Ayush1325/dotfiles/blob/2d13056bf8ca1931a234b72967d9e857c4afbf1a/uefi/.local/bin/uefi-run
2026-03-09 11:49:24 +01:00
Jonathan Brouwer fad370cc4a Rollup merge of #152800 - spirali:fix-FindParamInClause, r=lcnr
Adds recursion limit into FindParamInClause

Fixes rust-lang/rust#152716

r? lcnr
2026-03-09 11:49:23 +01:00
Jonathan Brouwer 9c09ff3dcd Rollup merge of #139692 - spastorino:do-not-rustfmt-ignore, r=Mark-Simulacrum
Rustfmt now support use closures

This should be merged when https://github.com/rust-lang/rustfmt/pull/6532 is used by CI's rustfmt.
2026-03-09 11:49:23 +01:00
Jonathan Brouwer b8e01edc24 Rollup merge of #153413 - joboet:organize-pal-os, r=Mark-Simulacrum
std: organise `sys::pal::os`

Continuing rust-lang/rust#153341, this moves around some functions in `sys::pal`, so that `pal::os` only contains standard-path-related code (which I'll move later as part of rust-lang/rust#117276).

Best reviewed commit-by-commit.
2026-03-09 11:49:22 +01:00
Jonathan Brouwer 2f5d672f46 Rollup merge of #153290 - Gelbpunkt:iter-repeat-n-trivial-drop-lower-bound-hermit, r=Mark-Simulacrum
tests: codegen-llvm: iter-repeat-n-trivial-drop: Allow non-zero lower bound to __rust_alloc size

LLVM emits a lower bound of 8 for the size parameter to `__rust_alloc` when targeting `x86_64-unknown-hermit`. Since that is also completely valid, relax the lower bound check.

I'm not really sure why LLVM is able to infer this - with the same setup targeting `x86_64-unknown-linux-gnu` I also see the lower bound of 0. Not that it's wrong, but I'd be curious to know which codegen options play into this.
2026-03-09 11:49:22 +01:00
Jonathan Brouwer a5bd6be835 Rollup merge of #152847 - Jamesbarford:chore/get_unchecked-inline-test, r=Mark-Simulacrum
Test for armv7 `get_unchecked(...)` inlining

Added test for `get_unchecked(...)` to be inlined on armv7.

closes https://github.com/rust-lang/rust/issues/131745
2026-03-09 11:49:21 +01:00
Guillaume Gomez d31a17fb0f Use DiagDecorator instead of derive(Diagnostic) in compiler/rustc_middle/src/mir/interpret/queries.rs 2026-03-09 11:35:33 +01:00
Guillaume Gomez 344344b83e Remove TyCtxt::node_span_lint usage from librustdoc 2026-03-09 11:35:33 +01:00
Guillaume Gomez 4e2a519d12 Remove TyCtxt::node_span_lint usage from rustc_trait_selection 2026-03-09 11:35:33 +01:00
Guillaume Gomez 3a64713bd5 Remove TyCtxt::node_span_lint usage from rustc_mir_transform 2026-03-09 11:35:33 +01:00
Guillaume Gomez 0d974a2cc0 Remove TyCtxt::node_span_lint usage from rustc_mir_build 2026-03-09 11:35:33 +01:00
Guillaume Gomez 01aff0d7fa Remove TyCtxt::node_span_lint usage from rustc_middle 2026-03-09 11:35:33 +01:00
Guillaume Gomez c45bf4a888 Remove TyCtxt::node_span_lint usage from rustc_lint 2026-03-09 11:19:53 +01:00
Guillaume Gomez 4019a92ca8 Add new rustc_errors::DiagDecorator type 2026-03-09 11:19:53 +01:00
James Barford-Evans 00980f438e Test for armv7 get_unchecked(...) inlining 2026-03-09 09:18:23 +00:00
Redddy e63664773c Move some ui tests
* Move dyn-drop to dyn-keyword
* Reorganize `tests/ui/empty` into specific dirs

remove tests/ui/empty/empty-linkname.rs duplicate of tests/ui/error-codes/E0454.rs
* Move `missing-trait-bounds` to `trait-bound/missing-trait-bounds`
* bless traits/missing-trait-bounds tests
* Move `recursion_limit` to `recursion/recursion_limit`
* Move `version` to `compile-flags`
2026-03-09 09:11:06 +00:00
bors 655a7d20fe Auto merge of #153427 - heiher:loong64-linux-relax, r=jieyouxu
Enable link relaxation feature for LoongArch Linux targets

This patch series enables the link relaxation feature for LoongArch Linux targets. Link relaxation is a link-time optimization that helps improve the quality and efficiency of the final binary. To support this, the corss-toolchain has also been bumped to handle more types of link relaxation.
2026-03-09 08:31:25 +00:00
bors 98e7077b90 Auto merge of #153025 - joboet:bytestr_precision_display, r=Mark-Simulacrum
core: respect precision in `ByteStr` `Display`

Fixes rust-lang/rust#153022.

`ByteStr`'s `Display` implementation didn't respect the precision parameter. Just like `Formatter::pad`, this is fixed by counting off the characters in the string and truncating after the requested length – with the added complication that the `ByteStr` needs to be divided into chunks first. By including a fast path that avoids counting the characters when no parameters were specified this should also fix the performance regressions caused by rust-lang/rust#152865.
2026-03-09 04:13:35 +00:00
bors eda4fc7733 Auto merge of #153579 - JonathanBrouwer:rollup-DFWynbC, r=JonathanBrouwer
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#152535 (std: use `OnceLock` for Xous environment variables)
 - rust-lang/rust#152646 (Update `UnsafeUnpin` impls involving extern types.)
 - rust-lang/rust#153559 (Inline and simplify some code for saving incremental data to disk)
 - rust-lang/rust#151900 (num: Separate public API from internal implementations)
 - rust-lang/rust#153520 (.mailmap: fix broken line with multiple emails)
 - rust-lang/rust#153573 (rustdoc-json: fix incorrect documentation for VariantKind::Struct)

Failed merges:

 - rust-lang/rust#153509 (Cleanup unused diagnostic emission methods - part 2)
2026-03-09 00:40:10 +00:00
Jonathan Brouwer 934afe30cd Rollup merge of #153573 - yshui-forks:rustdoc-types-doc, r=obi1kenobi,GuillaumeGomez
rustdoc-json: fix incorrect documentation for VariantKind::Struct

Seems to have been copy-and-pasted from `Enum::variants`, but `VariantKind::Struct::fields` is for struct variant fields, not enum variants.
2026-03-08 22:51:54 +01:00
Jonathan Brouwer 9b969739e9 Rollup merge of #153520 - DanielEScherzer:patch-4, r=lolbinarycat
.mailmap: fix broken line with multiple emails

Split binarycat's entry into multiple lines, one for each extra email
2026-03-08 22:51:53 +01:00
Jonathan Brouwer 83e6dbf9e1 Rollup merge of #151900 - tgross35:num-internal-imp, r=Mark-Simulacrum
num: Separate public API from internal implementations

Currently we have a single `core::num` module that contains both thin wrapper API and higher-complexity numeric routines. Restructure this by moving implementation details to a new `imp` module.

This results in a more clean separation of what is actually user-facing compared to items that have a stability attribute because they are public for testing.

The first commit does the actual change then the second moves a portion back.
2026-03-08 22:51:52 +01:00
Jonathan Brouwer 15a6976c86 Rollup merge of #153559 - Zalathar:persist, r=jackh726
Inline and simplify some code for saving incremental data to disk

Main changes:
- Inline `encode_query_cache` and `TyCtxt::serialize_query_result_cache`
- Pull value promotion out of `OnDiskCache::drop_serialized_data`
- Panic if `on_disk_cache` is None in an incremental-only path
2026-03-08 22:51:52 +01:00
Jonathan Brouwer e21a5df27e Rollup merge of #152646 - zachs18:unsafeunpin-marker-impls-pointee, r=Mark-Simulacrum
Update `UnsafeUnpin` impls involving extern types.

`UnsafeUnpin` tracking issue: https://github.com/rust-lang/rust/issues/125735

Relaxes from `T: ?Sized` (i.e. `T: MetaSized`) to `T: PointeeSized` for the `UnsafeUnpin` impls for pointers, references, and `PhantomData<T>`, and for the negative `UnsafeUnpin` impl for `UnsafePinned<T>`. (Compare to the impls for `Freeze` on lines 911-921.)

Both `UnsafeUnpin` and `extern type`s (the only way to have a `!MetaSized` type) are unstable, so this should have no effect on stable code.

Also updates the marker_impls macro docs to use PointeeSized bound, as most uses of the macro now do.

Concretely, this change means that the following types will newly implement `UnsafeUnpin`:

* pointers and references to `T` where `T` is an `extern type`
* `PhantomData<T>` where `T` is an extern type
* either of the above where `T` is a `struct` or tuple with `extern type` tail

Additionally, the negative `UnsafeUnpin` impl for `UnsafePinned<T>` is also relaxed to `T: PointeeSized` to align with the analogous negative `Freeze` impl for `UnsafeCell<T>`, even though both structs have `T: ?Sized` in their declaration (which probably should be relaxed, but that is a separate issue), so this part of the change doesn't actually *do* anything currently, but if `UnsafeCell` and `UnsafePinned` are later relaxed to `T: PointeeSized`, then the negative impl will apply to the newly possible instantiations. Also cc https://github.com/rust-lang/rust/issues/152645 that these impls compile at all.
2026-03-08 22:51:51 +01:00
Jonathan Brouwer 1ef29e7af6 Rollup merge of #152535 - joboet:xous_env_once_lock, r=Mark-Simulacrum
std: use `OnceLock` for Xous environment variables

There's no need for exposed-provenance-shenanigans here...

CC @xobs
2026-03-08 22:51:51 +01:00
bors b41f22de2a Auto merge of #153576 - JonathanBrouwer:rollup-oZYO7KY, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#153464 (Use `&C::Key` less in queries.)
 - rust-lang/rust#153553 (Remove the `rustc_data_structures::assert_matches!` re-exports)
 - rust-lang/rust#153561 (Replace the `try_mark_green` hook with direct calls to `tcx.dep_graph`)
 - rust-lang/rust#153564 (rendering interpreter OOM as OOM instead of ICE)
2026-03-08 18:05:25 +00:00
Jonathan Brouwer f0defb0de1 Rollup merge of #153564 - RalfJung:oom-is-not-ice, r=oli-obk
rendering interpreter OOM as OOM instead of ICE

Fixes https://github.com/rust-lang/rust/issues/149643.
Alternative to https://github.com/rust-lang/rust/pull/153481.
2026-03-08 19:04:37 +01:00
Jonathan Brouwer 35152ef343 Rollup merge of #153561 - Zalathar:try-mark-green, r=nnethercote
Replace the `try_mark_green` hook with direct calls to `tcx.dep_graph`

All of the existing call sites are directly touching `tcx.dep_graph` anyway, so the extra layer of indirection provides no real benefit.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
2026-03-08 19:04:37 +01:00
Jonathan Brouwer 11636013f9 Rollup merge of #153553 - Zalathar:assert-matches, r=lqd
Remove the `rustc_data_structures::assert_matches!` re-exports

- https://github.com/rust-lang/rust/pull/151359
- https://github.com/rust-lang/rust/pull/153462
---

Now that the bootstrap stage0 compiler has been bumped to 1.95, we can remove these temporary re-exports from `rustc_data_structures`, and once again import the `assert_matches!` macros directly from std.
2026-03-08 19:04:36 +01:00
Jonathan Brouwer 38108e1e0d Rollup merge of #153464 - nnethercote:less-ref-Key, r=Zalathar
Use `&C::Key` less in queries.

Currently we use a mix of `C::Key` and `&C::Key` parameters. The former is more common and a bit nicer, so convert some of the latter. This results in less converting between the two types, and fewer sigils.
2026-03-08 19:04:36 +01:00
Yuxuan Shui 43e3fd1944 rustdoc-json: fix incorrect documentation for VariantKind::Struct 2026-03-08 15:42:03 +00:00
Santiago Pastorino 85c4af74fa Rustfmt now support use closures on edition 2018 2026-03-08 10:22:26 -03:00
Ralf Jung 4f48642d1d rendering interpreter OOM as OOM instead of ICE 2026-03-08 13:27:05 +01:00
Nicholas Nethercote face186874 Use &C::Key less in queries.
Currently we use a mix of `C::Key` and `&C::Key` parameters. The former
is more common and a bit nicer, so convert some of the latter. This
results in less converting between the two types, and fewer sigils.
2026-03-08 22:54:12 +11:00
Zalathar 985b41d387 Remove the rustc_data_structures::assert_matches! re-exports 2026-03-08 22:02:23 +11:00
Zalathar 0a369a799f Replace the try_mark_green hook with direct calls to tcx.dep_graph
All of the existing call sites are directly touching `tcx.dep_graph` anyway, so
the extra layer of indirection provides no real benefit.
2026-03-08 21:53:13 +11:00
Zalathar d7490855d5 Inline and simplify some code for saving incremental data to disk
Main changes:
- Inline `encode_query_cache` and `TyCtxt::serialize_query_result_cache`
- Pull value promotion out of `OnDiskCache::drop_serialized_data`
- Panic if `on_disk_cache` is None in an incremental-only path
2026-03-08 21:27:50 +11:00
bors c7b206bba4 Auto merge of #153383 - nnethercote:overhaul-ensure_ok, r=Zalathar
Overhaul `ensure_ok`

The interaction of `ensure_ok` and the `return_result_from_ensure_ok` query modifier is weird and hacky. This PR cleans it up. Details in the individual commits.

r? @Zalathar
2026-03-08 07:03:35 +00:00
bors c3d014032f Auto merge of #153552 - Zalathar:rollup-MALCpPD, r=Zalathar
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#153202 ([win] Fix truncated unwinds for Arm64 Windows)
 - rust-lang/rust#153437 (coretest in miri: fix using unstable libtest features)
 - rust-lang/rust#153446 (Always use the ThinLTO pipeline for pre-link optimizations)
 - rust-lang/rust#153548 (add test for closure precedence in `TokenStream`s)
2026-03-08 03:45:00 +00:00
Stuart Cook 9886a13ab0 Rollup merge of #153548 - cyrgani:closuretest, r=JohnTitor
add test for closure precedence in `TokenStream`s

A test for a regression found by the https://github.com/rust-lang/rust/pull/151830 crater run in several different crates.
2026-03-08 14:01:36 +11:00
Stuart Cook cc0a60fd74 Rollup merge of #153446 - bjorn3:llvm_pre_link_thinlto, r=cuviper
Always use the ThinLTO pipeline for pre-link optimizations

When using cargo this was already effectively done for all dependencies as cargo passes -Clinker-plugin-lto without -Clto=fat/thin. -Clinker-plugin-lto assumes that ThinLTO will be used. The ThinLTO pre-link pipeline is faster than the fat LTO one. And according to the benchmarks in [^1] there is barely any runtime performance difference between executables that used fat LTO with the fat vs ThinLTO pre-link pipeline.

This also helps avoid having yet another code path if we want to support Unified LTO (that is a single bitcode file that supports being used for both fat LTO and ThinLTO when using linker plugin LTO, we already support it when rustc does LTO as ThinLTO bitcode is enough of a superset of fat LTO bitcode that it happens to work by accident if you don't explicitly have a check preventing mixing of them for the current set of LTO features that rustc exposes.) I'm currently still investigating if rustc would benefit from Unified LTO and how exactly to integrate it.

[^1]: https://discourse.llvm.org/t/rfc-a-unified-lto-bitcode-frontend/61774
2026-03-08 14:01:35 +11:00
Stuart Cook a508c476ac Rollup merge of #153437 - RalfJung:miri-libtest-unstable, r=cuviper
coretest in miri: fix using unstable libtest features

Alternative (IMO preferable) to https://github.com/rust-lang/rust/pull/153369. Also reverts that PR.
2026-03-08 14:01:35 +11:00