Commit Graph

52181 Commits

Author SHA1 Message Date
Guillaume Gomez d5b6bd87ec Merge commit '02f889aec5dc9b4e51d4cfd86c67ce5e4a0bbf72' 2025-12-21 00:13:38 +01:00
bors 24139cf844 Auto merge of #150199 - JonathanBrouwer:rollup-pjxlhel, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#150188 (Dogfood `strip_circumfix`)
 - rust-lang/rust#150198 (Port `#[thread_local]` to attribute parser)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-20 16:01:33 +00:00
Jonathan Brouwer 73292d90e8 Rollup merge of #150198 - Bryntet:parse_thread_local, r=JonathanBrouwer
Port `#[thread_local]` to attribute parser

Simple port, only thing that might be an issue is the `help: #[thread_local] can be applied to foreign statics and statics` it probably would be that if an attribute is applicable to both statics and foreign statics that we don't alphabetically sort them next to each other, because now it kinda reads like `#[thread_local]` is something that you primarily use on foreign statics

r? `@JonathanBrouwer`
2025-12-20 16:24:06 +01:00
Edvin Bryntesson 120f0d4f07 Port #[thread_local] to attribute parser 2025-12-20 15:38:42 +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
Yotam Ofek 462a8b3410 Dogfood strip_circumfix 2025-12-20 13:56:25 +02: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
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 2ffb1d55ef Handle bootstrap cfgs 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
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 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
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
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 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
bors 526a91cbcc Auto merge of #150105 - jackh726:remove-expressions-coerce, r=BoxyUwU
Remove Expressions (and just use a Vec) in coerce

Let's see if this has much of a perf impact - would be nice to clean this up a bit

r? ghost
2025-12-19 00:27:29 +00:00
Ben Kimock 4ff2c5c9f5 Don't treat asserts as a call in cross-crate inlining 2025-12-18 19:12:09 -05:00
Edvin Bryntesson 44cfed7465 Port #[rustc_lint_diagnostics] to attribute parser 2025-12-18 23:36:26 +01:00
Edvin Bryntesson 5277241d27 Port #[rustc_lint_untracked_query_information] to attribute parser 2025-12-18 23:33:25 +01:00
Moulins b31ee3af9c 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-18 22:25:34 +01:00
Jonathan Brouwer 5e9b3a08c8 Rollup merge of #150126 - bjorn3:sync_cg_clif-2025-12-18, r=bjorn3
Subtree sync for rustc_codegen_cranelift

Nothing too exciting since the last sync.

r? ``@ghost``

``@rustbot`` label +A-codegen +A-cranelift +T-compiler
2025-12-18 18:37:24 +01:00
Jonathan Brouwer 521aca2b17 Rollup merge of #150125 - Bryntet:parse_rustc_lint_opt_deny_field_access, r=JonathanBrouwer
Port `#[rustc_lint_opt_deny_field_access]` to attribute parser

r? ``@JonathanBrouwer``
2025-12-18 18:37:22 +01:00
Jonathan Brouwer ad4d6b9a17 Rollup merge of #150124 - DanielEScherzer:patch-1, r=petrochenkov
unstable.rs: fix typos in comments (implementatble -> implementable)
2025-12-18 18:37:21 +01:00
Jonathan Brouwer 4c9451bff8 Rollup merge of #150102 - jdonszelmann:fix-149982, r=Kivooeo
Fixed ICE for EII with multiple defaults due to duplicate definition in nameres

r? ``@jieyouxu`` (since you looked at the other one)

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

Previously a [fix was proposed](https://github.com/rust-lang/rust/pull/149985) by ``@SATVIKsynopsis`` which I marked as co-author on the first commit for the test they contributed. I'm closing this previous PR.

Duplicate definitions of EII defaults shouldn't be possible. I want to still panic on them, since I want to know when other bugs exist. However, in this case the duplicate was caused by something more subtle: both eiis have the same name, and as such a "duplicate definition" error is given. However, the compiler gracefully continues compiling despite that, assuming only one of the two EIIs is actually defined.

Both defaults then name resolve, and find the same single remaining EII, and both register themselves to be its default, breaking the single-default assumption.

The solution: I added a span-delayed-bug, to make sure we only panic if we hadn't previously had this duplicate definition name resolution error.

Thanks to ``@SATVIKsynopsis`` for their attempt. Adding a diagnostic here could make some sense, but nonetheless I think this is the better solution here <3
Also thanks to ``@yaahc`` for debugging help, she made me understand the name resolution of the situation so much better and is just lovely in general :3

The last commit is something I tried during debugging, which felt like a relevant test to add (one where both eiis also have the same function name)
2025-12-18 18:37:21 +01:00
Jonathan Brouwer 1e496bc9e6 Rollup merge of #150024 - aerooneqq:recursive-delegation-2, r=petrochenkov
Support recursive delegation

This PR adds support for recursive delegations and is a part of the delegation feature rust-lang/rust#118212.

r? ``@petrochenkov``
2025-12-18 18:37:17 +01:00