Commit graph

51441 commits

Author SHA1 Message Date
U. Lasiotus
02770b339b remote-test-server: make it build for Motor OS
Had to tweak linking options in target spec to make it work
(see https://github.com/moturus/motor-os/issues/46).
2025-11-16 09:49:16 -08:00
Stuart Cook
e5690e73bb
Rollup merge of #148777 - ywxt:depth_limit_error, r=petrochenkov
Lock shards while emitting depth limit error.

Locking shards avoids collect_active_jobs isn't able to be completed during emitting depth limit error.

fix rust-lang/rust#142159

Zulip: https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/panic.20while.20depth_limit_error/with/554616169

cc `@Zoxc`
2025-11-14 19:57:07 +11:00
Stuart Cook
f61bfb0037
Rollup merge of #148725 - scottmcm:experiment-new-try-block-v3, r=petrochenkov
Implement the alternative `try` block desugaring

As discussed in https://github.com/rust-lang/rfcs/pull/3721#issuecomment-3208342727, update the `try` in nightly to match the RFC as a way to experiment.

This addresses the following unresolved issue from https://github.com/rust-lang/rust/issues/31436

>  Address issues with type inference (`try { expr? }?` currently requires an explicit type annotation somewhere).
2025-11-14 19:57:06 +11:00
Stuart Cook
bf7d5539f7
Rollup merge of #148638 - chenyukang:yukang-fix-148634-repr-simd-enum-ice, r=Kivooeo,lcnr
Fix ICE for repr simd on non struct

Fixes rust-lang/rust#148634

The ICE happened because
995c11894f/compiler/rustc_middle/src/ty/mod.rs (L1531)

will always set `IS_SIMD` according to `get_all_attrs`, and since we already report error `attribute should be applied to a struct`, it's OK to bypass here.
2025-11-14 19:57:06 +11:00
bors
c880acdd31 Auto merge of #148931 - Zalathar:rollup-yfyhpcw, r=Zalathar
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#148543 (Correctly link to associated trait items in reexports)
 - rust-lang/rust#148808 (Some resolve cleanups)
 - rust-lang/rust#148812 (coverage: Associate hole spans with expansion tree nodes )
 - rust-lang/rust#148826 (CStr docs: Fix CStr vs &CStr confusion)
 - rust-lang/rust#148850 (Implement `Read::read_array`)
 - rust-lang/rust#148867 (Refactor `Box::take`)
 - rust-lang/rust#148870 (Remove unused LLVMModuleRef argument)
 - rust-lang/rust#148878 (error when ABI does not support guaranteed tail calls)
 - rust-lang/rust#148901 (Disable rustdoc-test-builder test partially for SGX target.)
 - rust-lang/rust#148902 (add missing s390x target feature to std detect test)
 - rust-lang/rust#148904 (waffle: stop watching codegen ssa)
 - rust-lang/rust#148906 (Expose fmt::Arguments::from_str as unstable.)
 - rust-lang/rust#148907 (add assembly test for infinite recursion with `become`)
 - rust-lang/rust#148928 (Move & adjust some `!`-adjacent tests)
 - rust-lang/rust#148929 (ignore `build-rust-analyzer` even if it's a symlink)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-14 05:29:52 +00:00
yukang
1610851356 add Tainted for NonAsmTypeReason 2025-11-14 12:42:50 +08:00
Scott McMurray
e5803fceed Move into_try_type to a free function 2025-11-13 19:53:02 -08:00
Stuart Cook
35a82b8dde
Rollup merge of #148878 - folkertdev:tail-call-unsupported-abi, r=WaffleLapkin
error when ABI does not support guaranteed tail calls

Some ABIs cannot support guaranteed tail calls. There isn't really an exhaustive list, so this is a best effort. Conveniently, we already disallow calling most of these directly anyway. The only exception that I was able to trigger an LLVM assertion with so far was `cmse-nonsecure-entry`.

For that calling convention, LLVM specifically notes that  (guaranteed) tail calls cannot be supported:

28dbbba6c3/llvm/lib/Target/ARM/ARMISelLowering.cpp (L2331-L2335)

---

I have some doubts about the implementation here though. I think it would be nicer to use `CanonAbi`, and move the `become` ABI check into `rustc_hir_typeck`, similar to `check_call_abi`:

d6deffe2de/compiler/rustc_hir_typeck/src/callee.rs (L157-L194)

Both the check for whether an ABI is callable and whether it supports guaranteed tail calls can then be methods (containing exhaustive matches) on `CanonAbi`. I'm however not sure

- if the ABI checks are deliberately only performed when constructing MIR
- what assumptions can be made about the `call` expression in [`check_expr_become`](d6deffe2de/compiler/rustc_hir_typeck/src/expr.rs (L1126-L1150)), it looks like currently the check that the "argument" to `become` is a function call also only occurs later during MIR construction

Are there issues with validating the ABI earlier in `rustc_hir_typeck` that I'm overlooking? I believe that we should already know the call's ABI and whether it is c-variadic at that point.

cc ````@workingjubilee```` for `CanonAbi`, ````@davidtwco```` for cmse
r? ````@WaffleLapkin````
2025-11-14 13:14:04 +11:00
Stuart Cook
9f07b25802
Rollup merge of #148870 - QnnOkabayashi:remove-unused-value, r=wesleywiser
Remove unused LLVMModuleRef argument
2025-11-14 13:14:03 +11:00
Stuart Cook
fead508238
Rollup merge of #148812 - Zalathar:expansions, r=JonathanBrouwer
coverage: Associate hole spans with expansion tree nodes

This PR is another incremental step towards expansion region support in coverage instrumentation.

When preparing coverage mappings for a function, we extract “raw” spans from MIR, and then use “hole” spans extracted from HIR to avoid overlap with nested items and closures. That hole-carving process was historically built around the assumption that there would be one set of spans and holes per function, but expansion region support will need to invalidate that assumption.

Therefore, to be more friendly to future work on expansion regions, this PR associates each hole span with its corresponding node in the expansion tree, and makes the span refinement step obtain holes from the current node.

There should be no change to compiler output.
2025-11-14 13:14:00 +11:00
Stuart Cook
ee40e0267c
Rollup merge of #148808 - nnethercote:resolve-cleanups, r=chenyukang,petrochenkov
Some resolve cleanups

Minor improvements I found while looking over this code.

r? ```````@petrochenkov```````
2025-11-14 13:14:00 +11:00
bors
6d41834e25 Auto merge of #147462 - Enselic:fix-basic-stepping-array, r=saethlin
rustc_codegen_llvm: Require `opt-level >= 1` for index-based write_operand_repeatedly() loop

To make debugger stepping intuitive with `-Copt-level=0`. See the adjusted `basic-stepping.rs` test.

This is kind of a revert of **bd0aae92dc (cg_llvm: use index-based loop in write_operand_repeatedly)**, except we don't revert it, we just make it conditional on `opt-level`. That commit regressed `basic-stepping.rs`, but it was not noticed since that test did not exist back then (it was added later in rust-lang/rust#144876). I have retroactively bisected to find that out.

It seems messy to sprinkle if-cases inside of
`write_operand_repeatedly()` so make the whole function conditional.

The test that bd0aae92dc added in
`tests/codegen/issues/issue-111603.rs` already use `-Copt-level=3`, so we don't need to adjust the compiler flags for it to keep passing.

This PR takes us one step closer to fixing rust-lang/rust#33013.

CC rust-lang/rust#147426 which is related (there will be trivial conflicts for me to resolve in basic-stepping.rs once one of them lands)
2025-11-14 02:12:16 +00:00
ywxt
a4d0507af7 Lock shards while collecting active jobs.
Co-authored-by: Zoxc <zoxc32@gmail.com>
2025-11-14 09:01:22 +08:00
bors
7a72c5459d Auto merge of #148896 - Kobzol:revert-146627, r=madsmtm
Revert "Rollup merge of #146627 - madsmtm:jemalloc-simplify, r=jdonszelmann"

This reverts commit 5dc3c19417, reversing
changes made to 11339a0ef5.

Reverts https://github.com/rust-lang/rust/pull/146627 due to a [perf regression](https://github.com/rust-lang/rust/pull/148851#issuecomment-3525797560).

r? `@Zalathar`
2025-11-13 21:15:20 +00:00
bors
2286e5d224 Auto merge of #148481 - GuillaumeGomez:subtree-update_cg_gcc_2025-11-04, r=GuillaumeGomez
Sync rustc_codegen_gcc subtree

cc `@antoyo`

r? ghost
2025-11-13 18:00:02 +00:00
Folkert de Vries
78beefed84
error when ABI does not support guaranteed tail calls 2025-11-13 15:31:37 +01:00
Jakub Beránek
ccd87959ed
Revert "Rollup merge of #146627 - madsmtm:jemalloc-simplify, r=jdonszelmann"
This reverts commit 5dc3c19417, reversing
changes made to 11339a0ef5.
2025-11-13 10:29:26 +01:00
Martin Nordholts
5ad2f434dc rustc_codegen_llvm: Require opt-level >= 1 for index-based loop
To make debugger stepping intuitive with `-Copt-level=0`. See the
adjusted `basic-stepping.rs` test.

This is kind of a revert of bd0aae92dc, except we don't revert it,
we just make it conditional on `opt-level`. That commit regressed
`basic-stepping.rs`, but it was not noticed since that test did not
exist back then. I have retroactively bisected to find that out.

It seems messy to sprinkle if-cases inside of the
`write_operand_repeatedly()` so make the whole function conditional.

The test that bd0aae92dc added in
`tests/codegen/issues/issue-111603.rs` already use `-Copt-level=3`, so
we don't need to adjust the compiler flags for it to keep passing.
2025-11-13 06:29:55 +01:00
bors
5dbf4069dc Auto merge of #148885 - Zalathar:rollup-wrvewer, r=Zalathar
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#147701 (rustdoc: don't ignore path distance for doc aliases)
 - rust-lang/rust#148735 (Fix ICE caused by invalid spans for shrink_file)
 - rust-lang/rust#148839 (fix rtsan_nonblocking_async lint closure ICE)
 - rust-lang/rust#148846 (add a test for combining RPIT with explicit tail calls)
 - rust-lang/rust#148872 (fix: Do not ICE when missing match arm with ill-formed subty is met)
 - rust-lang/rust#148880 (Remove explicit install of `eslint` inside of `tidy`'s Dockerfile)
 - rust-lang/rust#148883 (bootstrap: dont require cmake if local-rebuild is enabled)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-13 02:39:06 +00:00
Stuart Cook
17c25e4483
Rollup merge of #148872 - ShoyuVanilla:issue-148192, r=chenyukang
fix: Do not ICE when missing match arm with ill-formed subty is met

Fixes rust-lang/rust#148192

The ICE comes from the following line, calling `normalize_erasing_regions` to a projection type whose trait bound is not met:
2fcbda6c1a/compiler/rustc_pattern_analysis/src/rustc.rs (L185-L194)

The above function is called while trying to lint missing match arms, or scrutinize ctors of missing(not necessary error) match arms.

So, the following code can trigger ICEs.
```rust
trait WhereTrait {
    type Type;
}

fn foo(e: Enum) {
    match e {
        Enum::Map(_) => (), // ICE, while trying to lint missing arms
    }

    if let Enum::Map(_) = e {} // ICE, while trying to scrutinize missing ctors (even worse)
}

enum Enum {
    Map(()),
    Map2(<() as WhereTrait>::Type),
}
```

This ICE won't be triggered with the following code, as this is filtered out before `check_match` as the existence of ill-formed type inside the variant marks the body as tainted by error in `hir_typeck`, but for the above code, the `hir_typeck` complains nothing because everything it sees is locally correct.

```rust
fn foo(e: Enum) {
    match e {
        Enum::Map2(_) => (), // No ICE
    }
}
```

I've considered visiting and wf checking for the match scrutinee before entering `check_match`, but that might regress the perf and I think just emitting delayed bug would enough as the normalization failure would be originated by other errors like ill-formdness.
2025-11-13 11:57:10 +11:00
Stuart Cook
20f111f0d8
Rollup merge of #148839 - luca3s:rtsan_ice_fix, r=WaffleLapkin
fix rtsan_nonblocking_async lint closure ICE

Fixes https://github.com/rust-lang/rust/issues/148750, which i introduced in https://github.com/rust-lang/rust/pull/147935.
I also added the bug report to the tests.
2025-11-13 11:57:08 +11:00
Stuart Cook
06b18db01b
Rollup merge of #148735 - chenyukang:yukang-fix-ice-148732, r=nnethercote
Fix ICE caused by invalid spans for shrink_file

Fixes rust-lang/rust#148732

There are two issues in this function:
1. the original issue is caused by a typo error, which is fixed in the first commit
2. another different ice(Patch span `7..7` is beyond the end of buffer `0`) will be reported after fixing the first one, is caused by spans cross file boundaries due to macro expansion. It is fixed in the second commit.

r? `@nnethercote`

edited: also fixes rust-lang/rust#148684, added a new testcase for it in the last commit.
2025-11-13 11:57:07 +11:00
bors
503dce33e2 Auto merge of #148789 - m-ou-se:new-fmt-args-alt, r=wafflelapkin,jdonszelmann
New format_args!() and fmt::Arguments implementation

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

This is a new implementation of `format_args!()` and `fmt::Arguments`. With this implementation, `fmt::Arguments` is only two pointers in size. (Instead of six, before.) This makes it the same size as a `&str` and makes it fit in a register pair.

---

This `fmt::Arguments` can store a `&'static str` _without any indirection_ or additional storage. This means that simple cases like `print_fmt(format_args!("hello"))` are now just as efficient for the caller as `print_str("hello")`, as shown by this example:

> code:
> ```rust
> fn main() {
>     println!("Hello, world!");
> }
> ```
>
> before:
> ```asm
> main:
>  sub     rsp, 56
>  lea     rax, [rip + .Lanon_hello_world]
>  mov     qword ptr [rsp + 8], rax
>  mov     qword ptr [rsp + 16], 1
>  mov     qword ptr [rsp + 24], 8
>  xorps   xmm0, xmm0
>  movups  xmmword ptr [rsp + 32], xmm0
>  lea     rdi, [rsp + 8]
>  call    qword ptr [rip + std::io::stdio::_print]
>  add     rsp, 56
>  ret
> ```
>
> after:
> ```asm
> main:
>  lea     rsi, [rip + .Lanon_hello_world]
>  mov     edi, 29
>  jmp     qword ptr [rip + std::io::stdio::_print]
> ```

(`panic!("Hello, world!");` shows a similar change.)

---

This implementation stores all static information as just a single (byte) string, without any indirection:

> code:
> ```rust
> format_args!("Hello, {name:-^20}!")
> ```
>
> lowering before:
> ```rust
> fmt::Arguments::new_v1_formatted(
>     &["Hello, ", "!\n"],
>     &args,
>     &[
>         Placeholder {
>             position: 0usize,
>             flags: 3355443245u32,
>             precision: format_count::Implied,
>             width: format_count::Is(20u16),
>         },
>     ],
> )
> ```
>
> lowering after:
> ```rust
> fmt::Arguments::new(
>     b"\x07Hello, \xc3-\x00\x00\xc8\x14\x00\x02!\n\x00",
>     &args,
> )
> ```

This saves a ton of pointers and simplifies the expansion significantly, but does mean that individual pieces (e.g. `"Hello, "` and `"!\n"`) cannot be reused. (Those pieces are often smaller than a pointer to them, though, in which case reusing them is useless.)

---

The details of the new representation are documented in [library/core/src/fmt/mod.rs](https://github.com/m-ou-se/rust/blob/new-fmt-args-alt/library/core/src/fmt/mod.rs#L609-L712).
2025-11-12 23:21:24 +00:00
Nicholas Nethercote
b728064935 Add a helpful comment to DeriveResolution::exts. 2025-11-13 09:15:56 +11:00
Nicholas Nethercote
8ece93912c Remove trace argument from resolve_macro_or_delegation_path.
It's `true` at all call sites.
2025-11-13 09:15:56 +11:00
Nicholas Nethercote
258a446c89 Simplify Resolver::resolve_macro_path.
There are only two call sites, and three of the arguments are identical
at both call sites. This commit removes those arguments and renames the
method accordingly.
2025-11-13 09:15:44 +11:00
Shoyu Vanilla
dae003b04b fix: Do not ICE when missing match arm with ill-formed subty is met 2025-11-13 01:36:35 +09:00
Quinn Okabayashi
c7e50d0f37 Remove unused LLVMModuleRef argument 2025-11-12 15:46:08 +00:00
bors
d6deffe2de Auto merge of #148552 - chenyukang:yukang-fix-148392-closure-diag, r=petrochenkov
Provide more general note for borrowing outside of closure

Fixes rust-lang/rust#148392
2025-11-12 14:32:06 +00:00
Mara Bos
cfbdc2c36d Simplify loop in format_args lowering. 2025-11-12 14:56:58 +01:00
Mara Bos
832a525692 Add debug assert. 2025-11-12 14:30:20 +01:00
Mara Bos
8b20d0d0a1 Allow larger string pieces in fmt::Arguments repr. 2025-11-12 12:48:44 +01:00
Mara Bos
f92c5f1c09 Change assert to span_err. 2025-11-12 12:48:44 +01:00
Mara Bos
04c5e7b54a Document fmt::Arguments internal representation. 2025-11-12 12:48:39 +01:00
Mara Bos
560b12d094 Don't encode zero width or precision in fmt string. 2025-11-12 12:48:38 +01:00
Mara Bos
564c78fe62 Remove the 'always set' bit from FormattingOptions.
We don't need it anymore.
2025-11-12 12:48:37 +01:00
Mara Bos
d66d15be2b New format_args!()+fmt::Arguments implementation. 2025-11-12 12:45:40 +01:00
Mara Bos
756751bf0c Expose expr_unsafe in LoweringContext. 2025-11-12 12:45:40 +01:00
yukang
4a2c9a11d5 skip invalid span in error emitter 2025-11-12 17:47:15 +08:00
Stuart Cook
0675923ef8
Rollup merge of #148834 - Muscraft:fix-doctest-colors, r=fmease
fix(rustdoc): Color doctest errors

`@fmease's` [Deep analysis](https://github.com/rust-lang/rust/issues/148749#issuecomment-3508455278) on the problem
> Yeah, here's a deep analysis by me from a few weeks back of what's going on ([#148101 (comment)](https://github.com/rust-lang/rust/pull/148101#discussion_r2462756875)):
>
> > […]
> > However, since said PR ([#147207](https://github.com/rust-lang/rust/pull/147207): migrating coloring crates), `HumanEmitter::supports_color()` unconditionally(!) returns `false` (in fact, `Emitter::supports_color` is no longer used by anyone else and should be removed), so there's no reason to keep it. Rephrased, since that PR all compiler diagnostics for doctests are uncolored.
> > You could argue that I should keep it and patch `supports_color` in rustc to "work again". However, I'd rather rework our doctest coloring wholesale in a separate PR. At least before that migration PR, our setup was quite busted:
> >
> > 1. First of all, it didn't query+set `supports_color` for syntactically invalid doctests, so syntax errors were always shown without color (contrary to e.g., name resolution errors).
> > 2. Second of all, calling `supports_color()` here was quite frankly wrong: Piping the output of `rustdoc … --test` into a file (or `| cat` or whatever) did **not** suppress colors. I'm not actually sure if we can ever address that nicely (without stripping ANSI codes after the fact) since we pass that diagnostic to `libtest`, right? I might very well be wrong here, maybe it's a non-issue.

<hr>

```rust
/// ```
/// foo
/// ```
fn foo() {}
```
```
rustdoc --test lib.rs
```

Stable:
<img width="377" height="290" alt="stable" src="https://github.com/user-attachments/assets/cd20f947-b58d-42db-8735-797613baa9cc" />

Beta:
<img width="377" height="290" alt="beta" src="https://github.com/user-attachments/assets/f02588fd-41d2-4642-b03a-5554a68671eb" />

Nightly:
<img width="377" height="290" alt="nightly" src="https://github.com/user-attachments/assets/871cb417-f47e-4058-8a76-3bcd538ce141" />

After:
<img width="377" height="290" alt="after" src="https://github.com/user-attachments/assets/5734c01f-3f1c-44bb-9404-628c0c33b440" />

Note: This will need to be backported to `beta`

Fixes: rust-lang/rust#148749
2025-11-12 12:26:43 +11:00
Stuart Cook
672c6b603c
Rollup merge of #148819 - bjorn3:fix_fixme, r=jieyouxu
Remove specialized warning for removed target

It has been removed 9 months ago, which is more than a few months.
2025-11-12 12:26:41 +11:00
Stuart Cook
60b2068eed
Rollup merge of #148770 - folkertdev:naked-c-variadic, r=workingjubilee
implement `feature(c_variadic_naked_functions)`

tracking issue: https://github.com/rust-lang/rust/issues/148767

[#t-lang > C-variadic naked functions](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/C-variadic.20naked.20functions/with/554593886)

This feature allows naked c-variadic function definitions with any ABI that is supported for foreign c-variadic functions.

```rust
#![feature(c_variadic, c_variadic_naked_functions)]

#[unsafe(naked)]
unsafe extern "win64" fn variadic_win64(_: u32, _: ...) -> u32 {
    core::arch::naked_asm!(
        r#"
        push    rax
        mov     qword ptr [rsp + 40], r9
        mov     qword ptr [rsp + 24], rdx
        mov     qword ptr [rsp + 32], r8
        lea     rax, [rsp + 40]
        mov     qword ptr [rsp], rax
        lea     eax, [rdx + rcx]
        add     eax, r8d
        pop     rcx
        ret
    "#,
    )
}
```

r? ````@workingjubilee````
2025-11-12 12:26:40 +11:00
Stuart Cook
3b8d30becb
Rollup merge of #148531 - tamird:vendor-enum, r=nnethercote
rustc_target: introduce Abi, Env, Os

Improve type safety by using an enum rather than strings.

I'm not really sure this is better since only a few vendors have special semantics. r? ``@nnethercote``
2025-11-12 12:26:39 +11:00
Stuart Cook
a2c8493550
Rollup merge of #148465 - Jarcho:for_span, r=davidtwco,Zalathar
Adjust spans into the `for` loops context before creating the new desugaring spans.

When lowering `for` loops, the spans for the `into_iter` call and the `Some` pattern used the span of the provided pattern and head expression. If either of those came from a different `SyntaxContext` this would result in some very strange contexts. e.g.:

```rust
macro_rules! m { ($e:expr) => { { $e } } }
for _ in m!(expr) {}
```

This would result in the `into_iter` call have a context chain of `desugar => m!() => root` which is completely nonsensical; `m!()`  does not have a `for` loop. The `into_iter` call also ends up located at `{ $e }` rather than inside the `for _ in _` part.

This fixes that by walking the spans up to the `for` loop's context first. This will not handle adjusting the location of macro variable expansions (e.g. `for _ in $e`), but this does adjust the context to match the `for` loops.

---

This ended up causing rust-lang/rust-clippy#16008. Clippy should be using a `debug_assert` rather than `unreachable`, but it still results in a bug either way.
2025-11-12 12:26:38 +11:00
Stuart Cook
b98d127133
Rollup merge of #147974 - JohnTitor:diag-detect-buf-reuse-pattern, r=estebank
Improve diagnostics for buffer reuse with borrowed references

Addresses rust-lang/rust#147694

I'm not sure the current note wording is the best so I appreciate any feedback.
2025-11-12 12:26:36 +11:00
Stuart Cook
4cd28dea58
Rollup merge of #147753 - chenyukang:yukang-147749, r=fmease
Suggest add bounding value for RangeTo

Fixes rust-lang/rust#147749
2025-11-12 12:26:35 +11:00
Stuart Cook
5dc3c19417
Rollup merge of #146627 - madsmtm:jemalloc-simplify, r=jdonszelmann
Simplify `jemalloc` setup

In the past, `#[used]` had to appear in the top-level crate to have a consistent effect on the linker. This has been fixed a while ago for ELF with the introduction of the `symbols.o` file in https://github.com/rust-lang/rust/pull/95604, and more recently for Mach-O in https://github.com/rust-lang/rust/pull/133832, which means that libraries can now implement the required workarounds themselves. This allows moving these `#[used]` declarations out of our `main.rs`.

Specifically, I have moved them into `tikv-jemalloc-sys` where they belong in https://github.com/tikv/jemallocator/pull/109 and done the same for `mimalloc` in https://github.com/purpleprotocol/mimalloc_rust/pull/146 (in case we want to experiment with switching to that one day).

Test with:
```sh
./x build library src/tools/rustdoc src/tools/clippy --set rust.jemalloc=true

# macOS
lldb -- ./build/host/stage1/bin/rustc -vV
(lldb) b _rjem_je_zone_register
(lldb) run
# Should breakpoint, this means that the allocator was properly linked

# Linux
lldb -- ./build/host/stage1/bin/rustc -vV
(lldb) b malloc
(lldb) run
# Should breakpoint, inspect that the `malloc` symbol comes from the `rustc` binary and not from `libc`
```

try-job: `aarch64-gnu`
try-job: `dist-aarch64-linux`
try-job: `dist-x86_64-musl`
try-job: `dist-x86_64-apple`
try-job: `dist-aarch64-apple`
2025-11-12 12:26:35 +11:00
Scott Schafer
c523b65245
fix(rustdoc): Color doctest errors 2025-11-11 17:23:35 -07:00
Jason Newcomb
76067c446c Adjust spans into the for loops context before creating the pattern and into_iter call spans. 2025-11-11 19:18:19 -05:00
Tamir Duberstein
98a534e1fa
rustc_codegen_ssa: reduce repetition 2025-11-11 19:02:09 -05:00