3833 Commits

Author SHA1 Message Date
Jonathan Brouwer 09b8f72ef0 Rollup merge of #153090 - mati865:elf-raw-dylib-fns, r=TaKO8Ki
elf-raw-dylib: set type for functions

Avoids GNU ld warnings like:
```
type and size of dynamic symbol `meooooooooooooooow' are not defined
```
First noticed in https://github.com/rust-lang/rust/pull/152451#issuecomment-3880667900 with changes from https://github.com/rust-lang/rust/pull/149937.
2026-03-02 09:49:23 +01:00
Jonathan Brouwer ad4b2c01a1 Rollup merge of #153046 - bjorn3:cg_ssa_cleanups, r=TaKO8Ki
Couple of cg_ssa refactorings

These should help a bit with using cg_ssa in cg_clif at some point in the future.
2026-03-02 09:49:22 +01:00
Folkert de Vries e6cf5a22e7 test u128 passing on linux and windows 2026-02-27 10:51:55 +01:00
Folkert de Vries 31ae3d2be8 guaranteed tail calls: support indirect arguments 2026-02-27 10:24:39 +01:00
Jonathan Brouwer 5cd5b90a38 Port rustc_autodiff to the attribute parsers 2026-02-26 09:50:36 +01:00
Jacob Pratt cb78bc4dd4 Rollup merge of #151771 - hoodmane:wasm-double-panic, r=bjorn3
Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup

Previously this was not correctly implemented. Each funclet may need its own terminate block, so this changes the `terminate_block` into a `terminate_blocks` `IndexVec` which can have a terminate_block for each funclet. We key on the first basic block of the funclet -- in particular, this is the start block for the old case of the top level terminate function.

I also fixed the `terminate` handler to not be invoked when a foreign exception is raised, mimicking the behavior from msvc. On wasm, in order to avoid generating a `catch_all` we need to call `llvm.wasm.get.exception` and `llvm.wasm.get.ehselector`.
2026-02-25 21:42:53 -05:00
Mateusz Mikuła 30fc9bd384 elf-raw-dylib: set type for functions
Avoids GNU ld warnings like:
```
type and size of dynamic symbol `meooooooooooooooow' are not defined
```
First noticed in
https://github.com/rust-lang/rust/pull/152451#issuecomment-3880667900
with changes from https://github.com/rust-lang/rust/pull/149937.
2026-02-25 15:02:18 +01:00
bjorn3 df4b228c71 Merge const_data_from_alloc into static_addr_of
In Cranelift a Value can't hold arbitrarily sized values.
2026-02-25 11:11:06 +00:00
Jacob Pratt 6929f76311 Rollup merge of #153051 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer
Migration of `LintDiagnostic` - part 3

Follow-up of https://github.com/rust-lang/rust/pull/152933 and of https://github.com/rust-lang/rust/pull/153016.

More `LintDiagnostic` items being migrated to `Diagnostic`. Since there is no remaining `emit_node_span_lint` calls, I replaced the method with the code of `emit_diag_node_span_lint`.

r? @JonathanBrouwer
2026-02-24 22:51:42 -05:00
Jacob Pratt 9765a8b02e Rollup merge of #153032 - nnethercote:fix-attribute-names, r=JonathanBrouwer
Fix attribute parser and kind names.

For the attribute `FooBar` the parser is generally called `FooBarParser` and the kind is called `AttributeKind::FooBar`. This commit renames some cases that don't match that pattern. The most common cases:
- Adding `Rustc` to the front of the parser name for a `rustc_*` attribute.
- Adding `Parser` to the end of a parser name.
- Slight word variations, e.g. `Deprecation` instead of `Deprecated`, `Pointer` instead of `Ptr`, `Stability` instead of `Stable`.

r? @JonathanBrouwer
2026-02-24 22:51:42 -05:00
Jacob Pratt 989efb8423 Rollup merge of #153017 - makai410:di-unsafe-binder, r=wesleywiser
Implement debuginfo for unsafe binder types

Fixes: rust-lang/rust#139462

This treats an unsafe binder like a struct with a single field. This way we'd have the binder's distinct type name while keeping the wrapped value accessible.

Tracking:
- https://github.com/rust-lang/rust/issues/130516
2026-02-24 22:51:40 -05:00
Nicholas Nethercote 8971ad85af Fix attribute parser and kind names.
For the attribute `FooBar` the parser is generally called `FooBarParser`
and the kind is called `AttributeKind::FooBar`. This commit renames some
cases that don't match that pattern. The most common cases:
- Adding `Rustc` to the front of the parser name for a `rustc_*`
  attribute.
- Adding `Parser` to the end of a parser name.
- Slight word variations, e.g. `Deprecation` instead of `Deprecated`,
  `Pointer` instead of `Ptr`, `Stability` instead of `Stable`.
2026-02-25 08:46:47 +11:00
Guillaume Gomez 2bb3b01af2 Replace TyCtxt::emit_node_span_lint with emit_diag_node_span_lint 2026-02-24 20:34:22 +01:00
Hood Chatham acbfd79acf Fix: On wasm targets, call panic_in_cleanup if panic occurs in cleanup
Previously this was not correctly implemented. Each funclet may need its own terminate
block, so this changes the `terminate_block` into a `terminate_blocks` `IndexVec` which
can have a terminate_block for each funclet. We key on the first basic block of the
funclet -- in particular, this is the start block for the old case of the top level
terminate function.

Rather than using a catchswitch/catchpad pair, I used a cleanuppad. The reason for the
pair is to avoid catching foreign exceptions on MSVC. On wasm, it seems that the
catchswitch/catchpad pair is optimized back into a single cleanuppad and a catch_all
instruction is emitted which will catch foreign exceptions. Because the new logic is
only used on wasm, it seemed better to take the simpler approach seeing as they do the
same thing.
2026-02-24 17:47:27 +01:00
bjorn3 f03581a12b Introduce FunctionSignature associated type for BackendTypes
In Cranelift the regular Type enum can't represent function signatures.
Function pointers are represented as plain pointer sized integer.
2026-02-24 15:40:43 +00:00
bjorn3 e94aaf136d Reorder associated types in BackendTypes to be a bit more logical 2026-02-24 10:39:03 +00:00
bjorn3 e33e56225c Merge typeid_metadata into type_checked_load
This allows removing the Metadata associated type from BackendTypes.
2026-02-24 10:36:50 +00:00
bjorn3 811f708414 Remove CodegenBackend supertrait of ExtraBackendMethods 2026-02-24 10:34:10 +00:00
Jonathan Brouwer b55a3e403b Rollup merge of #153016 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer,Kivooeo
Migration of `LintDiagnostic` - part 2

Follow-up of https://github.com/rust-lang/rust/pull/152933.

More `LintDiagnostic` items being migrated to `Diagnostic`.

r? @JonathanBrouwer
2026-02-23 20:46:15 +01:00
Jonathan Brouwer 1894a0e969 Rollup merge of #152670 - bjorn3:lto_refactors12, r=petrochenkov
Simplify ThinLTO handling

This reduces the amount of complexity around ThinLTO module buffers. It removes duplication between `ModuleBuffer` and `ThinBuffer` (the latter was also used for fat LTO in some cases), clarifies when and where the ThinLTO summary is used (only for `--emit thin-link-bitcode`, ThinLTO performed by rustc rebuilds the summary every time). This also enables a follow up cleanup to reduce code duplication between red, green and imported codegen units.

Part of https://github.com/rust-lang/compiler-team/issues/908
2026-02-23 20:46:10 +01:00
Makai b6083435d8 implement debuginfo for unsafe binders 2026-02-23 23:32:56 +08:00
Guillaume Gomez 1a426a0b09 Migrate rustc_codegen_ssa to use TyCtxt::emit_diag_node_span_lint 2026-02-23 11:41:16 +01:00
Jonathan Brouwer 1f1e6bdb50 Rollup merge of #152933 - GuillaumeGomez:start-migrating-lintdiag, r=JonathanBrouwer
Start migration for `LintDiagnostic` items by adding API and migrating `LinkerOutput` lint

This is more or less the same approach as https://github.com/rust-lang/rust/pull/152811, but in a much smaller size to make it reviewable. A lot of PRs will follow though. :)

This PR creates the equivalent of `lint_level` working with `Diagnostic` and add new methods on `MultiSpan` to make it work as well (in particular because we need to copy messages/spans from one context to another).

r? @JonathanBrouwer
2026-02-22 11:31:17 +01:00
Guillaume Gomez 4f23c485ac Migrate LinkerOutput lint to Diagnostic 2026-02-21 13:35:13 +01:00
Matthias Krüger 7339fc5cec Rollup merge of #152929 - scottmcm:better-alignment-ranges, r=mati865
Tighten the `!range` bounds on alignments in vtables

Right now we're only telling LLVM that they're non-zero, but alignments must be powers of two so can't be more than `isize::MAX+1`.  And we actually never emit anything beyond LLVM's limit of 2²⁹, so outside of 16-bit targets the limit is that.

(Pulled out from rust-lang/rust#152867 which is starting to have too much in it.)
2026-02-21 13:03:28 +01:00
bjorn3 3decb52756 Remove last remaining ModuleBuffer/ThinBuffer duplication 2026-02-21 11:47:46 +00:00
bjorn3 ff454c12cd Simplify function signatures of serialize_module and prepare_thin 2026-02-21 11:47:45 +00:00
bjorn3 a086b3617e Remove ModuleBuffer ThinBuffer duplication 2026-02-21 11:47:45 +00:00
Scott McMurray 0187acccad Include the Align::MAX limit in the !range metadata for loading alignment from a vtable 2026-02-20 20:22:31 -08:00
Jonathan Brouwer b0cdafbd4a Rollup merge of #152455 - JonathanBrouwer:remove_translation, r=jdonszelmann
Remove the translation `-Z` options and the `Translator` type.

This PR implements MCP https://github.com/rust-lang/compiler-team/issues/967

It is split up into individually reviewable commits, each commit passes tests:

* https://github.com/rust-lang/rust/commit/678211956793a2e772414a71700a21525af6e67b Removes the translation compiler options from the session
* https://github.com/rust-lang/rust/commit/8f300d02fe8d2f01a39425925afd4cf3e15a822b Removes the now empty `Translator` type
* https://github.com/rust-lang/rust/commit/ab715c536fbd4ac09409e9a44eea2e25ea8a4f48 Renames `translate_message` to `format_diag_message`, as the function no longer does any translation
* https://github.com/rust-lang/rust/commit/8bcbc3f766af6242dcb52afe1ef4f6b1a9685019 Removes a section describing the removed compiler options from the rustc dev guide
2026-02-20 22:00:57 +01:00
Jonathan Brouwer bbce734ce0 Rollup merge of #152527 - bjorn3:remove_z_emit_thin_lto, r=cuviper
Remove -Zemit-thin-lto flag

As far as I can tell it was introduced in https://github.com/rust-lang/rust/pull/98162 to allow fat LTO with `-Clinker-plugin-lto`. In https://github.com/rust-lang/rust/pull/136840 a change was made to automatically disable ThinLTO summary generation when `-Clinker-plugin-lto -Clto=fat` is used, so we can safely remove it.

Fixes rust-lang/rust#152490
2026-02-20 22:00:56 +01:00
Jonathan Brouwer c0fe6943ae Rollup merge of #152759 - jdonszelmann:simpler-get-attrs, r=jonathanbrouwer
Simpler `find_attr!()`

r? @JonathanBrouwer
cc: @jyn514
2026-02-20 13:24:55 +01:00
bjorn3 6366a698e3 Remove -Zemit-thin-lto flag
As far as I can tell it was introduced to allow fat LTO with
-Clinker-plugin-lto. Later a change was made to automatically disable
ThinLTO summary generation when -Clinker-plugin-lto -Clto=fat is used,
so we can safely remove it.
2026-02-20 12:19:41 +00:00
Jana Dönszelmann decec173ec remove AttributeKind everywhere 2026-02-20 09:50:16 +01:00
Jana Dönszelmann 04f762d842 allow deprecated for some valid uses 2026-02-20 09:50:16 +01:00
Jana Dönszelmann 9a9443950d change all uses 2026-02-20 09:50:16 +01:00
Jana Dönszelmann 63edc913fa change all uses 2026-02-20 09:50:16 +01:00
bors 59fd4ef94d Auto merge of #152747 - nnethercote:bring-back-enum-DepKind, r=Zalathar
Bring back `enum DepKind`.

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/152747)*

It was removed in rust-lang/rust#115920 to enable it being moved to `rustc_query_system`, a move that has recently been reversed. It's much simpler as an enum.

r? @Zalathar
2026-02-20 06:07:20 +00:00
bors fbd6934114 Auto merge of #152825 - JonathanBrouwer:rollup-0YvwE70, r=JonathanBrouwer
Rollup of 18 pull requests

Successful merges:

 - rust-lang/rust#152799 (Subtree sync for rustc_codegen_cranelift)
 - rust-lang/rust#152814 (stdarch subtree update)
 - rust-lang/rust#151059 (x86: support passing `u128`/`i128` to inline assembly)
 - rust-lang/rust#152097 (Suggest local variables for captured format args)
 - rust-lang/rust#152734 (Respect the `--ci` flag in more places in bootstrap)
 - rust-lang/rust#151703 (Fix ICE in transmutability error reporting when type aliases are normalized)
 - rust-lang/rust#152173 (Reflection TypeKind::FnPtr)
 - rust-lang/rust#152564 (Remove unnecessary closure.)
 - rust-lang/rust#152628 (tests: rustc_public: Check const allocation for all variables (1 of 11 was missing))
 - rust-lang/rust#152658 (compiletest: normalize stderr before SVG rendering)
 - rust-lang/rust#152766 (std::r#try! - avoid link to nightly docs)
 - rust-lang/rust#152780 (Remove some clones in deriving)
 - rust-lang/rust#152787 (Add a mir-opt test for alignment check generation [zero changes outside tests])
 - rust-lang/rust#152790 (Fix incorrect target in aarch64-unknown-linux-gnu docs)
 - rust-lang/rust#152792 (Fix an ICE while checking param env shadowing on an erroneous trait impl)
 - rust-lang/rust#152793 (Do no add -no-pie on Windows)
 - rust-lang/rust#152803 (Avoid delayed-bug ICE for malformed diagnostic attrs)
 - rust-lang/rust#152806 (interpret: fix comment typo)
2026-02-19 04:18:20 +00:00
Nicholas Nethercote 90b994b883 Rename query dep_kind.
The next commit will bring back `enum DepKind` and there would be a
variant `DepKind::dep_kind`. This makes it impossible to have a variable
named `dep_kind`, because the `bindings_with_variant_name` lint is
overzealous. For this code:
```
let dep_kind = DepKind::dep_kind;
```
the lint will give this error:
```
pattern binding `dep_kind` is named the same as one of the variants of the type `DepKind`
```
This is arguably a bug in the lint. To work around it, this commit
renames the `dep_kind` query as `crate_dep_kind`. It is a better name
anyway given that `DepKind` and `CrateDepKind` are different things.
2026-02-19 08:56:43 +11:00
Jonathan Brouwer a1e029b8ba Rollup merge of #152793 - mati865:disable-no-pie-on-windows, r=petrochenkov
Do no add -no-pie on Windows

Windows binaries are always position independent and Clang warns when trying to enable or disable that:
```
❯ clang hello.c -pie
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

❯ clang hello.c -no-pie
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
```

https://github.com/rust-lang/rust/pull/149937 will turn these warnings into build errors:
```
❯ cargo rustc -- -D linker-messages
   Compiling hello v0.1.0 (E:\tmp\hello)
error: linker stderr: x86_64-w64-mingw32-clang: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]␍
       x86_64-w64-mingw32-clang: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]␍

  |
  = note: requested on the command line with `-D linker-messages`

error: could not compile `hello` (bin "hello") due to 1 previous error
```
2026-02-18 22:19:54 +01:00
bors e0cb264b81 Auto merge of #141295 - Kivooeo:if-let-guard-stable, r=fee1-dead,est31
Stabilize `if let` guards (`feature(if_let_guard)`)



## Summary

This proposes the stabilization of `if let` guards (tracking issue: rust-lang/rust#51114, RFC: rust-lang/rfcs#2294). This feature allows `if let` expressions to be used directly within match arm guards, enabling conditional pattern matching within guard clauses.

## What is being stabilized

The ability to use `if let` expressions within match arm guards.

Example:

```rust
enum Command {
    Run(String),
    Stop,
    Pause,
}

fn process_command(cmd: Command, state: &mut String) {
    match cmd {
        Command::Run(name) if let Some(first_char) = name.chars().next() && first_char.is_ascii_alphabetic() => {
            // Both `name` and `first_char` are available here
            println!("Running command: {} (starts with '{}')", name, first_char);
            state.push_str(&format!("Running {}", name));
        }
        Command::Run(name) => {
            println!("Cannot run command '{}'. Invalid name.", name);
        }
        Command::Stop if state.contains("running") => {
            println!("Stopping current process.");
            state.clear();
        }
        _ => {
            println!("Unhandled command or state.");
        }
    }
}
```

## Motivation

The primary motivation for `if let` guards is to reduce nesting and improve readability when conditional logic depends on pattern matching. Without this feature, such logic requires nested `if let` statements within match arms:

```rust
// Without if let guards
match value {
    Some(x) => {
        if let Ok(y) = compute(x) {
            // Both `x` and `y` are available here
            println!("{}, {}", x, y);
        }
    }
    _ => {}
}

// With if let guards
match value {
    Some(x) if let Ok(y) = compute(x) => {
        // Both `x` and `y` are available here
        println!("{}, {}", x, y);
    }
    _ => {}
}
```

## Implementation and Testing

The feature has been implemented and tested comprehensively across different scenarios:

### Core Functionality Tests

**Scoping and variable binding:**
- [`scope.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/scope.rs) - Verifies that bindings created in `if let` guards are properly scoped and available in match arms
- [`shadowing.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/shadowing.rs) - Tests that variable shadowing works correctly within guards
- [`scoping-consistency.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/scoping-consistency.rs) - Ensures temporaries in guards remain valid for the duration of their match arms

**Type system integration:**
- [`type-inference.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/type-inference.rs) - Confirms type inference works correctly in `if let` guards  
- [`typeck.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/typeck.rs) - Verifies type mismatches are caught appropriately

**Pattern matching semantics:**
- [`exhaustive.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/exhaustive.rs) - Validates that `if let` guards are correctly handled in exhaustiveness analysis
- [`move-guard-if-let.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/move-guard-if-let.rs) and [`move-guard-if-let-chain.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/move-guard-if-let-chain.rs) - Test that conditional moves in guards are tracked correctly by the borrow checker

### Error Handling and Diagnostics

- [`warns.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/warns.rs) - Tests warnings for irrefutable patterns and unreachable code in guards
- [`parens.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/parens.rs) - Ensures parentheses around `let` expressions are properly rejected
- [`macro-expanded.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.rs) - Verifies macro expansions that produce invalid constructs are caught
- [`guard-mutability-2.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/guard-mutability-2.rs) - Tests mutability and ownership violations in guards
- [`ast-validate-guards.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs) - Validates AST-level syntax restrictions

### Drop Order and Temporaries

**Key insight:** Unlike `let_chains` in regular `if` expressions, `if let` guards do not have drop order inconsistencies because:
1. Match guards are clearly scoped to their arms
2. There is no "else block" equivalent that could cause temporal confusion

- [`drop-order.rs`](https://github.com/rust-lang/rust/blob/5796073c134eaac30475f9a19462c4e716c9119c/tests/ui/rfcs/rfc-2294-if-let-guard/drop-order.rs) - Check drop order of temporaries create in match guards
- [`compare-drop-order.rs`](https://github.com/rust-lang/rust/blob/aef3f5fdf052fbbc16e174aef5da6d50832ca316/tests/ui/rfcs/rfc-2294-if-let-guard/compare-drop-order.rs) - Compares drop order between `if let` guards and nested `if let` in match arms, confirming they behave identically across all editions
- rust-lang/rust#140981 - A complicated drop order test involved `let chain` was made by @est31
- [`drop-order-comparisons-let-chains.rs`](https://github.com/rust-lang/rust/blob/902b4d28783e03e231d8513082cc30c4fcce5d95/tests/ui/drop/drop-order-comparisons-let-chains.rs) - Compares drop order between `let chains` in `if let guard` and regular `if` expressions
- [`if-let-guards.rs`](https://github.com/rust-lang/rust/blob/5650d716e0589e2e145ce9027f35bd534e5f862a/tests/ui/drop/if-let-guards.rs) - Test correctness of drop order for bindings and temporaries
- [`if-let-guards-2`](https://github.com/rust-lang/rust/blob/3a6c8c8f3d7ae654fdb6ce1255182bda21680655/tests/ui/drop/if-let-guards-2.rs) - The same test as above but more comprehensive and tests more interactions between different features and their drop order, checking that drop order is correct, created by @traviscross 

## Edition Compatibility

This feature stabilizes on all editions, unlike `let chains` which was limited to edition 2024. This is safe because:

1. `if let` guards don't suffer from the drop order issues that affected `let chains` in regular `if` expressions
2. The scoping is unambiguous - guards are clearly tied to their match arms
3. Extensive testing confirms identical behavior across all editions

## Interactions with Future Features

The lang team has reviewed potential interactions with planned "guard patterns" and determined that stabilizing `if let` guards now does not create obstacles for future work. The scoping and evaluation semantics established here align with what guard patterns will need.

## Unresolved Issues

- [x] - rust-lang/rust#140981
- [x] - added tests description by @jieyouxu request
- [x] - Concers from @scottmcm about stabilizing this across all editions
- [x] - check if drop order in all edition when using `let chains` inside `if let` guard is the same
- [x] - interactions with guard patters
- [x] - pattern bindings drops before guard bindings https://github.com/rust-lang/rust/pull/143376
- [x] - documentaion (https://github.com/rust-lang/reference/pull/1957)
- [ ] (non-blocking) add tests for [this](https://github.com/rust-lang/rust/issues/145237) and [this](https://github.com/rust-lang/rust/pull/141295#issuecomment-3173059821)

---

**Related:**
- Tracking Issue: rust-lang/rust#51114  
- RFC: rust-lang/rfcs#2294
- Documentation PR: https://github.com/rust-lang/reference/pull/1957
2026-02-18 20:49:50 +00:00
Mateusz Mikuła 92e60a324f Do no add -no-pie on Windows
Windows binaries are always position independent
and Clang warns when trying to enable or disable
that:
```
❯ clang hello.c -pie
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

❯ clang hello.c -no-pie
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
```
2026-02-18 11:24:13 +01:00
Camille Gillot 6d4b1b38e7 Remove ShallowInitBox. 2026-02-17 11:25:50 +00:00
Kivooeo 964b63f42e if let guard stabilize 2026-02-16 12:24:15 +00:00
bjorn3 fa753a46c1 Remove code for ThinLTO from cg_gcc
It was just a dummy implementation to workarround the fact that thin
local lto is the default in rustc. By adding a thin_lto_supported thin
local lto can be automatically disabled for cg_gcc, removing the need
for this dummy implementation. This makes improvements to the LTO
handling on the cg_ssa side a lot easier.
2026-02-15 10:05:48 +00:00
Jonathan Brouwer 018a5efcf7 Rename inline_fluent! to msg! 2026-02-14 13:47:52 +01:00
Jacob Pratt 22f973db34 Rollup merge of #152568 - JonathanBrouwer:port_lang, r=jdonszelmann
Port `#[lang]` and `#[panic_handler]` to the new attribute parsers

For https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163

r? @jdonszelmann
2026-02-13 22:26:35 -05:00
Jacob Pratt 202f102914 Rollup merge of #152573 - usamoi:escape-2, r=bjorn3
move `escape_symbol_name` to `cg_ssa`

followup of rust-lang/rust#151955

r? @bjorn3
2026-02-13 22:26:33 -05:00
Jacob Pratt 4571317d32 Rollup merge of #151998 - zmodem:naked_visibility.squash, r=saethlin,bjorn3
Set hidden visibility on naked functions in compiler-builtins

88b46460fa made builtin functions hidden, but it doesn't apply to naked functions, which are generated through a different code path.

This was discovered in rust-lang/rust#151486 where aarch64 outline atomics showed up in shared objects, overriding the symbols from compiler-rt.
2026-02-13 22:26:31 -05:00