Commit Graph

313698 Commits

Author SHA1 Message Date
Justin Geibel 93fbf3b885 Drop the From derive macro from the v1 prelude
This was accidentally added to the prelude in
3f4dc1e02d.
2025-12-20 11:45:48 -05:00
bors b53da99081 Auto merge of #150190 - matthiaskrgr:rollup-tjdmcar, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#146747 (rustc_codegen_llvm: Tidying of `update_target_reliable_float_cfg`)
 - rust-lang/rust#148499 (Nvptx: Use llbc as default linker)
 - rust-lang/rust#148991 (miri genmc: fix exit() handling)
 - rust-lang/rust#150172 (Handle remapped paths correctly when generating "Source" links)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-20 12:48:06 +00:00
Matthias Krüger 6c0e803afa Rollup merge of #150172 - Urgau:rustdoc-remap-fixes, r=GuillaumeGomez
Handle remapped paths correctly when generating "Source" links

Fixes https://github.com/rust-lang/rust/issues/150100.

This PR fixes a regression introduced by [#149709](https://github.com/rust-lang/rust/issues/149709), I was overzealous in my changes (https://github.com/rust-lang/rust/pull/149709/changes#diff-e1cf7ef2fb411d24980cd4cbea1e867cc36029e9496e1ceca64cfb6a0e3510f6) and accidentally changed the behavior of `rustdoc` in the presence of remapped, to simply reject them instead of handling them.

With this PR remapped paths are handled correctly, in a similar way as it was before.

~~I added a run-make test to make sure we don't regress it again, a simple `rustdoc` test in not sufficient as `rustdoc` is not called on the auxiliary crate. It's not pretty but it works.~~ https://github.com/rust-lang/rust/pull/150172#issuecomment-3676762399

rustdoc doesn't have any handling for `--remap-path-scope`, so I used the `MACRO` scope (it was already used [elsewhere](https://github.com/rust-lang/rust/blob/b889870082dd0b0e3594bbfbebb4545d54710829/src/librustdoc/clean/types.rs#L154).

cf. https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/source.20links.20missing.20for.20nightly.20std.20docs
2025-12-20 13:46:01 +01:00
Matthias Krüger ce3f9039d9 Rollup merge of #148991 - RalfJung:genmc-exit, r=oli-obk
miri genmc: fix exit() handling

In genmc mode, Miri does not want to stop execution when `exit` is called. Instead we want to continue running other threads to ensure we covered all possible concurrent behaviors (including the ones where the exiting thread was delayed so the other threads took their turns first). However, the core interpreter has a sanity check that prevents us from just doing nothing in `exit`. This leaves us in a pickle: there's nowhere we can jump to (exit has return type `!` so there's no next block), but if we don't jump anywhere we ICE.

The first commit fixes that by disabling the sanity check when there is no block to jump to. That still catches the mistake of forgetting to jump for the vast majority of shims.

We currently don't build Miri's genmc integration in rustc CI so I had to hack the feature into the bootstrap miri integration. That turned out to use the wrong Miri binary, which is fixed by the second commit: we can just rely on CARGO_BIN_EXE_miri, there's no need for a MIRI environment variable.

r? ``@oli-obk``
2025-12-20 13:46:00 +01:00
Matthias Krüger 5a875b8580 Rollup merge of #148499 - kjetilkjeka:nvptx_default_linker_llbc, r=madsmtm
Nvptx: Use llbc as default linker

The implementation of [MCP: Use `llvm-bitcode-linker` as the default linker for `nvptx64-nvidia-cuda`](https://github.com/rust-lang/compiler-team/issues/927)
2025-12-20 13:46:00 +01:00
Matthias Krüger 676348b75c Rollup merge of #146747 - a4lg:codegen-llvm-feature-float-tidying, r=petrochenkov
rustc_codegen_llvm: Tidying of `update_target_reliable_float_cfg`

This PR simplifies floating type handling through `update_target_reliable_float_cfg` based on several facts:

1.  Major changes in behavior normally occurs only on the major LLVM upgrade.
2.  The first release of LLVM 20.x.x is 20.1.0.

Due to the first fact, we can normally ignore minor and patch releases of LLVM and we can remove obscure variables like `lt_xx_x_x`.
The second fact is missed when the minimum LLVM version is raised to LLVM 20 (cf. rust-lang/rust#145071) and one "fixed in LLVM 20" case can be safely removed (another cannot be removed since it's fixed on LLVM 20.1.1).

It also reorders certain `match` clauses by the architecture when there's no problems reordering it.

Note that, an LLVM issue on MIPS is fixed on LLVM 20.1.**0** and another on AArch64 is fixed on LLVM 20.1.**1**.
Originally, they are both considered fixed on LLVM 20.1.**1** but the author separated them into two cases (so that the MIPS bug checking can be removed).
2025-12-20 13:45:59 +01:00
bors d0835adc4e Auto merge of #150181 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

13 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..3861f60f6b58f57524c0e7aab1f5c1ad83e35409
2025-12-13 16:29:21 +0000 to 2025-12-19 21:53:33 +0000
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
2025-12-20 08:28:57 +00:00
Tsukasa OI 42d9f099e0 rustc_codegen_llvm: Reorder by arch in update_target_reliable_float_cfg
This commit reorders certain match clauses in
`update_target_reliable_float_cfg` by the architecture when
there's no problems reordering it.
2025-12-20 07:21:01 +00:00
Tsukasa OI 28203e182f rustc_codegen_llvm: Simplify update_target_reliable_float_cfg
This commit simplifies floating type handling through
`update_target_reliable_float_cfg` based on several facts:

1.  Major changes in behavior normally occurs only
    on the major LLVM upgrade.
2.  The first release of LLVM 20.x.x is 20.1.0.

Due to the first fact, we can normally ignore minor and patch releases
of LLVM and we can remove obscure variables like `lt_xx_x_x` (still,
there is a case where checking for patch version is required).

The second fact is missed when the minimum LLVM version is raised to
LLVM 20 and one "fixed in LLVM 20" case can be safely removed.
2025-12-20 07:21:01 +00:00
Tsukasa OI 572ca1eb74 rustc_codegen_llvm: Split "Fixed in LLVM 20" cases
... in `update_target_reliable_float_cfg`, based on the actual changes.
The AArch64 issue is fixed on LLVM 20.1.1 while the MIPS issue is fixed
on LLVM 20.1.0 (the first LLVM 20 release).

This commit distinguishes two separate cases.
2025-12-20 07:21:01 +00:00
bors 838a912ced Auto merge of #150177 - matthiaskrgr:rollup-4cw3gdw, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#149633 (Enable `outline-atomics` by default on AArch64 FreeBSD)
 - rust-lang/rust#149788 (Move shared offload globals and define per-kernel globals once)
 - rust-lang/rust#149989 (Improve filenames encoding and misc)
 - rust-lang/rust#150012 (rustc_target: Add `efiapi` ABI support for LoongArch)
 - rust-lang/rust#150116 (layout: Store inverse memory index in `FieldsShape::Arbitrary`)
 - rust-lang/rust#150159 (Split eii macro expansion code)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-20 05:17:27 +00:00
bors f51d1bcdc6 Auto merge of #149831 - BoxyUwU:boostrap_bump, r=Mark-Simulacrum,cuviper
bump bootstrap compiler to 1.93 beta

r? release
2025-12-20 02:06:29 +00:00
Weihang Lo 3e5b12ed9a Update cargo submodule 2025-12-19 21:06:09 -05:00
Guillaume Gomez c039edd414 Fix typo 2025-12-20 00:32:56 +01:00
Josh Stone b22b343faf Revert "Generate macro expansion for rust compiler crates docs"
This reverts commit c820f46122 due to an
ICE encountered while bumping the bootstrap compiler to 1.93-beta.
2025-12-19 15:06:11 -08:00
Boxy df780f87c7 Update compiler/rustc_lint_defs/src/builtin.rs
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2025-12-19 15:04:30 -08:00
Boxy Uwu 8321ad2369 update missing targets list 2025-12-19 15:04:30 -08:00
Boxy Uwu 2ffb1d55ef Handle bootstrap cfgs 2025-12-19 15:04:30 -08:00
Boxy Uwu 93fc203606 bump stage0 2025-12-19 15:04:30 -08:00
Boxy Uwu 90a33f69f4 replace version placeholder 2025-12-19 15:04:30 -08:00
Matthias Krüger 8022c68ac8 Rollup merge of #150159 - jdonszelmann:split-eii-macro, r=jonathanbrouwer
Split eii macro expansion code

r? jonathanbrouwer (since you did the last one too, should be quite trivial)

While investigating rust-lang/rust#149980 I decided this code deserved some splitting :)
2025-12-19 23:39:00 +01:00
Matthias Krüger 22440fd686 Rollup merge of #150116 - moulins:layout-inv-memory-index, r=workingjubilee
layout: Store inverse memory index in `FieldsShape::Arbitrary`

All usages of `memory_index` start by calling `invert_bijective_mapping`, so storing the inverted mapping directly saves some work and simplifies the code.
2025-12-19 23:38:59 +01:00
Matthias Krüger fdae594a74 Rollup merge of #150012 - heiher:loong-efiapi, r=davidtwco
rustc_target: Add `efiapi` ABI support for LoongArch

This commit adds basic `efiapi` ABI support for LoongArch by recognizing `extern "efiapi"` in the ABI map and inline asm clobber handling, and mapping it to the C calling convention.

This change is intentionally submitted ahead of the full LoongArch UEFI target support. While UEFI binaries are ultimately produced as PE images, LoongArch UEFI applications can already be developed by building ELF objects, applying relocation fixups, and converting them to PE in a later step. For such workflows, having `efiapi` properly recognized by the compiler is a prerequisite, even without a dedicated UEFI target.

Landing this ABI support early helps unblock LoongArch UEFI application and driver development, and allows the remaining UEFI-specific pieces to be introduced incrementally in follow-up patches.

MCP: https://github.com/rust-lang/compiler-team/issues/953
2025-12-19 23:38:59 +01:00
Matthias Krüger 7ec7a928c4 Rollup merge of #149989 - Urgau:filenames-post-improvements, r=davidtwco
Improve filenames encoding and misc

This PR is a follow-up to https://github.com/rust-lang/rust/pull/149709, it aims at preventing a double encoding when there are no remapping, as well as making some small improvements to the code.

Best reviewed commit by commit.
2025-12-19 23:38:58 +01:00
Matthias Krüger 508c382080 Rollup merge of #149788 - Sa4dUs:offload-cleanup, r=ZuseZ4
Move shared offload globals and define per-kernel globals once

This PR moves the shared LLVM global variables logic out of the `offload` intrinsic codegen and generates kernel-specific variables only ont he first call of the intrinsic.

r? `@ZuseZ4`

tracking:
- https://github.com/rust-lang/rust/issues/131513
2025-12-19 23:38:57 +01:00
Matthias Krüger 056da3e0ca Rollup merge of #149633 - tgross35:freebsd-outline-atomics, r=davidtwco
Enable `outline-atomics` by default on AArch64 FreeBSD

Many aarch64 targets without LSE in the baseline enable the
`outline-atomics` feature, which uses runtime detection of LSE for its
faster atomic ops. This provides nontrivial performance improvements on
most hardware from the past decade, at a small cost to anything pre-LSE.

This matches what Clang does [1].

Context: https://github.com/rust-lang/rust/pull/144938

[1]: https://github.com/llvm/llvm-project/commit/e24f90190c772b6fdd915cd0a2e55cbd468c3024

try-job: dist-x86_64-freebsd
2025-12-19 23:38:57 +01:00
bors 9044e98b66 Auto merge of #150111 - daxpedda:wasm-gc, r=alexcrichton
Add `target_feature = "gc"` for Wasm

This PR adds a new target feature for Wasm targets: [GC](https://github.com/WebAssembly/gc).

~~I went ahead and made this insta-stable because it has already [passed phase 5](https://github.com/WebAssembly/proposals/blob/88e7bd6ba9bc585135edcb4def2c4d284f5fd0fc/finished-proposals.md) in addition to being [implemented and stabilized by all major JS engines](https://webassembly.org/features).~~

~~This doesn't enable the target feature by default!~~

For context: while this proposal adds a lot of new features to Wasm, they are not accessible through Rust apart from unstable inline ASM. This is largely useful to signal tools to make use of the feature, e.g. `wasm-bindgen`, where this can be used to make some pretty optimizations.

Companion PR: https://github.com/rust-lang/reference/pull/2114.

r? `@alexcrichton`
2025-12-19 22:35:39 +00:00
Urgau 811c241b3d Handle remapped paths correctly when generating "Source" links 2025-12-19 23:22:08 +01:00
Urgau 81d86bf0eb Add regression test for remap-path-prefix handling in rustdoc for deps 2025-12-19 23:21:24 +01:00
Kjetil Kjeka 746acc47a1 Nvptx: Use llbc as default linker 2025-12-19 21:39:48 +01:00
daxpedda 4ee01c4e4c Add target_feature = "gc" for Wasm 2025-12-19 20:22:43 +01:00
bors 806c2a35dc Auto merge of #150056 - Kivooeo:trying-to-address-perf, r=davidtwco
Perf regression fix

The only thing changed from the previous PR is that I removed `output_is_inhabited` from hot path, and hide it behind condition, so now it will compute it less frequent

follow up on https://github.com/rust-lang/rust/pull/149664
2025-12-19 18:18:11 +00:00
Jana Dönszelmann 6608f6ace7 split up expansion code of eii macro into functions 2025-12-19 18:43:04 +01:00
bors b889870082 Auto merge of #150158 - Zalathar:rollup-dqazzrn, r=Zalathar
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#150121 (mir_build: Don't use a mixture of THIR pattern kinds for pin-patterns)
 - rust-lang/rust#150148 (mir_build: Remove unnecessary lifetime from THIR `PatCtxt`)
 - rust-lang/rust#150150 (move eii tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-19 14:57:07 +00:00
Stuart Cook 77491e7878 Rollup merge of #150150 - jdonszelmann:move-eii-tests, r=JonathanBrouwer
move eii tests

Just a little housekeeping. This feature is getting a lot of tests, so it felt good to put some tests for type checking in its own folder to organise a little. Should be trivial!
2025-12-20 00:32:32 +11:00
Stuart Cook f140bba8d9 Rollup merge of #150148 - Zalathar:pat-ctxt, r=Nadrieril
mir_build: Remove unnecessary lifetime from THIR `PatCtxt`

It turns out that lifetime `'a` is just `'tcx` in disguise.
2025-12-20 00:32:31 +11:00
Stuart Cook 0e64ced2f7 Rollup merge of #150121 - Zalathar:pin-pat, r=Nadrieril
mir_build: Don't use a mixture of THIR pattern kinds for pin-patterns

While looking for improvements to match-lowering, I had been trying to figure out why pin-patterns sometimes use `PatKind::Deref` and sometimes use `PatKind::DerefPattern`, which seemed confusing to me. In particular, both pattern kinds are being used with an inner type of `&` or `&mut`, which is very surprising.

The conclusion I came to was that `DerefPattern` (normally associated with calls to Deref/DerefMut) was only being used for *implicit* pin-patterns produced by match-ergonomics adjustment, whereas `Deref` was being used for explicit pin-patterns.

The inconsistency seems like a mistake to me, so this PR removes all uses of `DerefPattern` for pin-patterns, and consistently uses `PatKind::Deref` for pin-patterns instead. I'm not entirely happy with that outcome, because I think pin-patterns should probably have their own `thir::PatKind` variant, but this change will at least make that easier to achieve in a later PR.

r? Nadrieril
2025-12-20 00:32:31 +11:00
Marcelo Domínguez 04c2d2be13 Remove region_id unnamed attr 2025-12-19 13:27:14 +01:00
Marcelo Domínguez 8bafb63202 Remove outdated comment 2025-12-19 13:27:14 +01:00
Marcelo Domínguez 3e4944d573 Split runtime global logic and cache kernel specific one 2025-12-19 13:27:13 +01:00
bors 1d8f9c548d Auto merge of #150110 - Urgau:remap-relative-library, r=jieyouxu
Prefer remapping the relative `library/` and `compiler/` directories

This is done to avoid leaking the relative paths to the standard library after the overall of filenames in rust-lang/rust#149709.

Noted that the paths were already leaking before, but to a lesser extent since most (but not all) the paths embedded in the distributed `rlib` were absolute.

In general Cargo compiles workspace members with relative paths, so it's better anyway to remap the relative path.

In addition to our tests I have manually confirmed that it also works as expected for the printed diagnostics paths.

cf. https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/remapping.20of.20the.20standard.20library/near/564093571
2025-12-19 11:45:11 +00:00
Jana Dönszelmann c040bb1c7e move eii tests 2025-12-19 12:42:49 +01:00
Zalathar 7e63bc07de mir_build: Remove unnecessary lifetime from PatCtxt
It turns out that lifetime `'a` is just `'tcx` in disguise.
2025-12-19 19:59:43 +11:00
bors 0f0d850e91 Auto merge of #150147 - matthiaskrgr:rollup-8zp68z1, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#147430 (cg_llvm: More preparation for moving FFI bindings to `rustc_llvm`)
 - rust-lang/rust#149815 (Add regression test for rust-lang/rust#120189)
 - rust-lang/rust#150127 (Port `#[rustc_lint_untracked_query_information]` and `#[rustc_lint_diagnostics]` to using attribute parsers)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-19 08:34:14 +00:00
Matthias Krüger 0e623bbe0b Rollup merge of #150127 - Bryntet:parse_rustc_lint_untracked_query_information, r=JonathanBrouwer
Port `#[rustc_lint_untracked_query_information]` and `#[rustc_lint_diagnostics]` to using attribute parsers

r? ``@JonathanBrouwer``
2025-12-19 09:25:26 +01:00
Matthias Krüger eb0f57507c Rollup merge of #149815 - is57primenumber:add-slp-vectorize-test, r=chenyukang
Add regression test for #120189

This PR adds regression tests for rust-lang/rust#120189.
I added tests to verify vectorization of loops inside closures.
2025-12-19 09:25:25 +01:00
Matthias Krüger 91821aa0c0 Rollup merge of #147430 - Zalathar:inherent, r=chenyukang
cg_llvm: More preparation for moving FFI bindings to `rustc_llvm`

- Sequel to https://github.com/rust-lang/rust/pull/147327
- Motivated by https://github.com/rust-lang/rust/pull/142897

---

This is another batch of adjustments to code that would otherwise interfere with moving FFI bindings out of `rustc_codegen_llvm` and into `rustc_llvm`.
2025-12-19 09:25:24 +01:00
bors 07a5b02a2d Auto merge of #117192 - saethlin:leaves-can-assert, r=scottmcm
Don't treat asserts as a call in cross-crate inlining

Making functions with calls in their bodies automatically cross-crate-inlinable tends to tank incremental build times. Though assert terminators are _like_ calls, they don't exhibit the same behavior.
2025-12-19 04:39:08 +00:00
Zalathar 735a980693 Move DIBuilderBox out of ffi.rs 2025-12-19 12:32:49 +11:00
Zalathar c2f8ee9bba Remove inherent methods from llvm::TypeKind 2025-12-19 12:32:49 +11:00