Commit Graph

4283 Commits

Author SHA1 Message Date
Jonathan Brouwer
99f6df7fc7 Rollup merge of #163574 - tgross35:intrinsics-abort-rename, r=clarfonthey
intrinsics: Rename `abort` to `abort_immediate`

The semantics of `intrinsics::abort()` are closer to what we have unstably as `abort_immediate()` than to `process::abort()` or `libc::abort()`. Rename it to make more clear that the intrinsic is more of an intentional crash with platform-specific behavior than what `libc::abort()` tries to be (i.e. raising `SIGABRT`).

If desired, a new intrinsic like `abort_gracefully` could be introduced that performs platform-specific behavior. This would more cleanly unblock https://github.com/rust-lang/rust/pull/149780.

See also discussion at the tracking issue for `immediate_abort` https://github.com/rust-lang/rust/issues/154601.
2026-10-02 22:39:48 +02:00
Trevor Gross
e9b0eeb99d intrinsics: Rename abort to abort_immediate
The semantics of `intrinsics::abort()` are closer to what we have
unstably as `abort_immediate()` than to `process::abort()` or
`libc::abort()`. Rename it to make more clear that the intrinsic is more
of an intentional crash with platform-specific behavior than what
`libc::abort()` tries to be (i.e. raising `SIGABRT`).
2026-10-02 18:56:41 +00:00
Antoni Boucher
4613f38cc5 Send -fno-lto when linker plugin LTO is not requested to avoid having GCC do LTO when using rustc_codegen_gcc 2026-10-02 09:49:01 -04:00
bjorn3
d731edabc0 Remove #[linkage = "common"]
A common definition is like a weak definition except that it must be a
zero-initialized static and when merging two common symbols with the
same name, the size and alignment are set to the higher of both symbols.
This is used for tentative definitions in C and doesn't have any reason
to exist outside of that. This behavior doesn't work across dylibs and
common symbols have inconsistent behavior across linkers [1]. It is also
fragile to rely on getting the largest size of all common symbol
definitions as a (possibly smaller) global definition can override it.

Link: https://maskray.me/blog/all-about-common-symbols [1]
2026-09-30 16:59:42 +02:00
Trevor Gross
5365b214a6 Rollup merge of #163428 - RalfJung:unstable-target-feature, r=petrochenkov
do not complain about unstable target features on nightly

This was brought up in https://github.com/rust-lang/rust/issues/162235#issuecomment-5856608121: we currently print a warning on nightly saying that using an unstable target feature will become a hard error. That's a mistake.

We could either remove the part of the warning that talks about it becoming a hard error, or we could just hide the warning entirely for unstable features on nighty. I went for the latter -- nightly is meant for experimentation with those features so having un-silenceable warnings is not great.

Cc @workingjubilee
2026-09-28 23:20:42 -05:00
Trevor Gross
538a927606 Rollup merge of #162493 - jakos-sec:ubsan-runtime-minimal, r=rcvalle
Add support for -Zsanitizer-cfi-minimal-runtime

For production use, we should only link in the ubsan_minimal runtime,
instead of the complete ubsan runtime. This adds support for both
cfi-recover and cfi-diag to use the minimal runtime when
`-Zsanitizer-cfi-minimal-runtime` is specified.

This also includes tests, to ensure the flag can only be used if either
cfi-recover or cfi-diag is enabled, it doesn't disrupt the original
behavior, and links in the correct runtime when specified.

cc @1c3t3a

?r rcvalle
2026-09-28 23:20:40 -05:00
Ralf Jung
48b2592ad8 do not complain about unstable target features on nightly 2026-09-28 19:36:23 +02:00
bors
c1070d6938 Auto merge of #163449 - JonathanBrouwer:rollup-RD7XqTw, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#163327 (remove `MutTy`)
 - rust-lang/rust#162910 (Deterministic encoding of `DefPathHashMap`)
 - rust-lang/rust#163009 (dont store arbitrary parsed attributes in thir)
 - rust-lang/rust#162683 (Use attribute parser for `#[inline()]` attribute check)
 - rust-lang/rust#163429 (lint on `Ident::from_str_and_span` taking a string literal)
 - rust-lang/rust#163431 (Allow `#[repr(simd)]` with `f16b`)
 - rust-lang/rust#163433 (Support also `try-jobs:` to specify custom try jobs)
2026-09-28 15:28:49 +00:00
mejrs
d3d2163b20 dont store arbitrary parsed attributes in thir 2026-09-28 14:43:44 +02:00
Jonathan Brouwer
b36d57558d Rollup merge of #163289 - pmur:murp/llvm-stack-size, r=oli-obk
Ensure llvm worker threads have sufficient stack space

The rustc driver sets the default stack size to 16MB, however worker threads spawned by the backend will use std's default stack size (usually 2MB).

Pass through the stack size chosen by the driver to the backend, and explicitly request the stack size.

This probably isn't the preferred way to do this, but maybe a starting point to educate me.

This doesn't catch every spawned thread (jobserver and ctrlc also create them through std). Are there other threads which might be sensitive to small stack sizes?

Fixes rust-lang/rust#163272
2026-09-28 14:19:38 +02:00
Jacob Pratt
1d6d8b861b Rollup merge of #163307 - nnethercote:less-SpanData-in-diagnostics, r=bjorn3
Less `SpanData` in diagnostics

`SpanData` should really just be an internal detail of `Span`, and its use is worth minimizing. This PR gets rid of two uses.
Details in individual commits.

r? @bjorn3
2026-09-27 21:51:43 -04:00
Jonathan Brouwer
d20a388a88 Rollup merge of #163378 - RalfJung:is_some_and_none_or, r=mejrs
use is_some_and / is_none_or in a few more places

IMO that makes the code more readable.

Clippy also lints this by default these days, but we don't run that lint on the compiler it seems.
2026-09-27 18:58:14 +02:00
Jonathan Brouwer
1c87a25d83 Rollup merge of #163250 - mejrs:hir_imports3, r=JonathanBrouwer
Remove rustc_hir's attribute re-exports

Followup to https://github.com/rust-lang/rust/pull/160336, see also rust-lang/rust#163170, rust-lang/rust#163207 and rust-lang/rust-clippy/pull/17714

Very minor touchups here and there, nothing involving code changes.

r? @JonathanBrouwer
2026-09-27 18:58:12 +02:00
Ralf Jung
3b2363d3ce use is_some_and / is_none_or in a few more places 2026-09-26 17:09:13 +02:00
Jacob Pratt
7756b3ed4a Rollup merge of #163290 - nnethercote:merge-warning-levels, r=oli-obk
Merge `ForceWarning`/`Allow`/`Expect` into `Warning`

Because they're all just special cases of warnings. Details in individual commits.

r? @oli-obk
2026-09-26 01:33:19 -04:00
Nicholas Nethercote
fcf74ea737 Merge ForceWarning/Allow/Expect into Warning
Because they're all just special cases of warnings. This requires
introducing a new `Option<EmissionOverride>` field to `Warning` that
describes the special case behaviour; the `DiagInner::lint_id` field
also gets merged in.

Specific nice things about this:

- Removes some unreachable match arms for `Allow`/`Expect`.

- Removes the hacky upgrading of `Allow`/`Expect` to `Warning` in
  `emit_future_breakage_report`.

- The types now have structure that used to be maintained by comments
  and assertions. E.g. it's now impossible to not have a `lint_id` for
  an `expect` lint. (I always found the `DiagInner::lint_id` field
  confusing; it's clearer now.)

- There's a nice comment on `EmissionOverride` summarizing all the
  different cases.

- A little less code overall.
2026-09-26 07:47:13 +10:00
mejrs
564f208ba9 compiler: remove rustc_hir attr re-exports 2026-09-25 18:39:43 +02:00
Paul Murphy
0f125fae31 Ensure llvm worker threads have sufficient stack space
The rustc driver sets the default stack size to 16MB, however
worker threads spawned by the backend will use std's default
stack size (usually 2MB).

Pass through the stack size chosen by the driver to the backend,
and explicitly request the stack size.
2026-09-25 09:22:55 -05:00
Ariel Ben-Yehuda
5237e38fdd Support -Z merge-functions with gcc and add stack-protector asm tests
This is a part of the stack-protector work.

Adding support for merge-functions is not strictly needed, but it does
prevent breakage if the GCC function merging logic changes.

Not adding tests for -Z merge-functions since I don't see any such tests for the
LLVM side of it.
2026-09-25 15:17:18 +03:00
Nicholas Nethercote
f01eea524c Remove the SpanData in InlineAsmError
By just storing `lo` and `hi` instead.
2026-09-25 16:13:26 +10:00
Nicholas Nethercote
e47397562a Remove rustc_codegen_ssa:🔙:write::Diagnostic
It's a cut down version of `rustc_errors::DiagInner` that avoids `Span`.
It exists because `Span` used to not impl `Send` and so couldn't be sent
from codegen threads to the main thread. But that's no longer true and
we can send `DiagInner`s directly now.
2026-09-25 16:13:26 +10:00
bors
f340ff6a39 Auto merge of #163265 - JonathanBrouwer:rollup-RZQ8eQg, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#163218 (stdarch subtree update)
 - rust-lang/rust#159287 (Build a new incr comp session dir from scratch every time)
 - rust-lang/rust#163222 (Enable EII tests for cg_gcc)
 - rust-lang/rust#163251 (cg_gcc subtree sync 2026-09-24)
 - rust-lang/rust#162595 (avoid accessing uninferred closure upvars in diagnostics)
 - rust-lang/rust#162937 (do generic_const_args Const::Ty hack only on projection consts)
 - rust-lang/rust#163238 (Fix incorrect use of await in parser suggestion)
2026-09-24 14:19:04 +00:00
Jonathan Brouwer
f0f6653e3b Rollup merge of #159287 - bjorn3:incr_comp_session_from_scratch, r=nnethercote
Build a new incr comp session dir from scratch every time

Rather than copying the old incr comp dir and then modifying it. This saves a copy/hardlink for files that are modified. And it removes the need for accurate work product tracking to avoid accumulating cruft, which is non-trivial. We don't accurately track the pre-LTO bitcode files for ThinLTO for example.

Part of https://github.com/rust-lang/compiler-team/issues/908
2026-09-24 16:05:26 +02:00
bjorn3
5ed0180b64 Build a new incr comp session dir from scratch every time
Rather than copying the old incr comp dir and then modifying it. This
saves a copy/hardlink for files that are modified. And it removes the
need for accurate work product tracking to avoid accumulating cruft,
which is non-trivial. We don't accurately track the pre-LTO bitcode
files for ThinLTO for example.
2026-09-24 12:34:06 +02:00
Jonathan Brouwer
c2b722880b Rollup merge of #163188 - dpaoliello:arm64ecsymboledit, r=lqd,bjorn3
Adjust for Arm64EC name mangling when checking for exported symbols

After rust-lang/rust#160679 the Arm64EC nightly validation run internally by Microsoft started failing with:

```
=== STDOUT ===
main.c
main.obj : error LNK2019: unresolved external symbol my_add referenced in function #my_add$exit_thunk (EC Symbol)
main.obj : error LNK2019: unresolved external symbol my_hash_lookup referenced in function #my_hash_lookup$exit_thunk (EC Symbol)
main.obj : error LNK2019: unresolved external symbol call_internal referenced in function #call_internal$exit_thunk (EC Symbol)
main.obj : error LNK2019: unresolved external symbol my_safe_div referenced in function #my_safe_div$exit_thunk (EC Symbol)
main.exe : fatal error LNK1120: 4 unresolved externals
```

Root cause is that `symbol_edit` wasn't compensating for Arm64EC's name mangling, and so these symbols were missed.
2026-09-24 09:38:11 +02:00
Jakob Koschel
20b6fd6221 Address review feedback
Only check `SanitizerCfiMinimalRuntimeRequiresCfiRecoverOrDiag` if CFI
is actually enabled.

Use `is_sanitizer_cfi_minimal_runtime_enabled()` helper within
`link.rs`.
2026-09-23 20:20:57 +00:00
Daniel Paoliello
270556173c Adjust for Arm64EC name mangling when checking for exported symbols 2026-09-23 09:51:44 -07:00
Jonathan Brouwer
856b213184 Rollup merge of #163196 - nnethercote:rm-DiagInner-sort_span, r=lqd
Remove `DiagInner::sort_span`

It's a field that can be used for sorting diagnostics. By default it is set to the primary span. It's only used for `BorrowckDiagnosticsBuffer`.

This commit removes it and adds a `sort_span` to each diagnostic recorded in `BorrowckDiagnosticsBuffer`. This avoids various other pieces of code having to deal with it.

r? @lqd
2026-09-23 13:43:26 +02:00
Flakebi
039b8bcadc Add address_space and byref to abi PassMode::Indirect
Both will be used by the amdgpu target to implement the `gpu-kernel`
ABI.

`address_space` specifies the address space of an indirect argument.

`AmdgpuKernelArg` translates to LLVM’s byref, which is similar to
on_stack/byval, however, there is no extra copy made, the pointer may
not point to the stack but can point to some other address space, and
the passed argument should not be modified.

byval and byref are mutually exclusive, so change on_stack to an enum
with the new states, Pointer (none), OnStack and AmdgpuKernelArg.
2026-09-23 09:56:28 +02:00
Nicholas Nethercote
8084d720c5 Remove DiagInner::sort_span
It's a field that can be used for sorting diagnostics. By default it is
set to the primary span. It's only used for `BorrowckDiagnosticsBuffer`.

This commit removes it and adds a `sort_span` to each diagnostic
recorded in `BorrowckDiagnosticsBuffer`. This avoids various other
pieces of code having to deal with it.
2026-09-23 15:57:35 +10:00
James Barford-Evans
af2f1f375c use ConstExt for methods that do not yet exist in rustc_type_ir 2026-09-22 13:04:44 +01:00
Jonathan Brouwer
e1b8be29ff Rollup merge of #160859 - Jamesbarford:feat/fb16-pt1, r=folkertdev,tgross35
`core::num::f16b` Rust's 16bit Brain Float

Implements the [RFC: f16b type](https://github.com/rust-lang/rfcs/pull/3983). Best reviewed commit by commit, happy to split into separate PRs if that is deemed easier to review. However the line count and surface area is, in my opinion, reasonably small.

Adds;
- ABI plumbing for the `f16b` along with `bfloat` lang item to work with LLVM, GCC is explicitly `unimplemented!(...)`
- `f16b` feature gate, page for `f16b` on libruscdoc and a `struct bf16` in `core::num`
- Tests
- Treat `f16b` as a scalar primitive for scalable vectors

Issues;
- [Tracking Issue](https://github.com/rust-lang/rust/issues/160630)
- [RFC](https://github.com/rust-lang/rfcs/pull/3983)
2026-09-21 15:19:23 +02:00
Jonathan Brouwer
2b1343d4a8 Rollup merge of #160679 - cezarbbb:staticlib-rename-coff, r=bjorn3
Staticlib rename internal symbols: add COFF support

Follow-up to rust-lang/rust#156950.

`-Zstaticlib-rename-internal-symbols` now also works on COFF targets (Windows). Renaming only rewrites symbol names, so unlike hide it needs no visibility concept.

COFF objects keep their string table at the end of the file, so renames append the new names there and patch the 4-byte length prefix plus each symbol's name offset in place. Both regular and bigobj objects are handled; on i686 a leading underscore is stripped when matching against the exported set. The archive format differs (GNU ar on windows-gnu, COFF on windows-msvc) but the members are always COFF objects, so the existing archive code is unchanged.

Supported on ELF, Apple, and COFF targets. `-Zstaticlib-hide-internal-symbols` remains ELF/Apple-only and still warns on Windows.

A run-make test `staticlib-rename-internal-symbols-coff` mirrors the existing ELF and Mach-O tests.

r? @bjorn3
2026-09-21 15:19:22 +02:00
Jonathan Brouwer
a7be2941de Rollup merge of #163083 - nnethercote:rm-Diag-G, r=oli-obk
Remove `G` generic param from `Diag<'_, G>`

The benefits are outweighed by the costs. Details in invidual commits.

some minor earlier discussion about this change in https://github.com/rust-lang/rust/pull/162630#discussion_r3988468478
2026-09-21 15:19:21 +02:00
Jakob Koschel
1bd00d4f72 Add support for -Zsanitizer-cfi-minimal-runtime
For production use, we should only link in the ubsan_minimal runtime,
instead of the complete ubsan runtime. This adds support for both
cfi-recover and cfi-diag to use the minimal runtime when
`-Zsanitizer-cfi-minimal-runtime` is specified.

This also includes tests, to ensure the flag can only be used if either
cfi-recover or cfi-diag is enabled, it doesn't disrupt the original
behavior, and links in the correct runtime when specified.

Co-Authored-By: Bastian Kersting <bkersting@google.com>
2026-09-21 09:43:59 +00:00
James Barford-Evans
c56a9917d8 Wire up f16b in backends 2026-09-21 08:57:52 +01:00
James Barford-Evans
cdde2f00b5 Add F16B to Float enum & wireup trivial matches 2026-09-21 08:57:51 +01:00
Nicholas Nethercote
30b8dfc353 Remove G generic param from Diag<'_, G>
It encodes the `emit` behaviour, one of:
- `BugAbort`: Abort as a bug.
- `FatalAbort`: Abort as a fatal error.
- `ErrorGuaranteed`: Return an `ErrorGuaranteed` (the default).
- `()`: return `()`.

This is useful but `Diag` is very widely used and it's arguably not
useful enough to be worth the generic parameter. This commit removes it.

Benefits:
- Many fewer generic parameters, including many functions where the
  genericity is entirely uninteresting. This includes every
  `Diagnostic::into_diag` and `Subdiagnostic::add_to_diag`. Removes the
  need for the comment about `<G>` on `trait Diagnostic`.
- No `PhantomData` in `Diag`.
- Makes bootstrapping a bit faster.

The downside is there is no longer a single `emit` method.
- Getting a `!` return type requires calling `emit_bug` or `emit_fatal`.
  This only affects a few call sites.
- Getting an `ErrorGuaranteed` return type requires calling `emit_err`.
  This affects a lot of call sites. (It arguably makes call sites more
  self-documenting.)
- Using the wrong `emit_*` on a diagnostic causes a runtime abort, which
  previously couldn't occur. Seems unlikely, but it's not impossible.
- Note: If no particular return type is needed, `emit` can be used for
  any diagnostic. (Bug/fatal diagnostics will still trigger abort.)
2026-09-21 09:57:42 +10:00
Nicholas Nethercote
23ba1fae5f Convert create_err(e).emit() occurrences to emit_err(e) 2026-09-21 09:57:26 +10:00
bjorn3
27ed2eda12 Introduce LockedDir type 2026-09-18 12:10:15 +02:00
cezarbbb
f330047c2b Add COFF support to -Zstaticlib-rename-internal-symbols 2026-09-18 10:36:09 +08:00
Nicholas Nethercote
8515e12560 Remove global_backend_features query
It's now possible to get the backend features (a `Vec<String>`) when the
codegen backend is started, pass it back through `CodegenBackendInit`,
and just store it in the `Session`. This removes the need for the query.

Also:

- `WriteBackendMethods::target_machine_factory` no longer needs the
  `target_features` parameter, because it's now available through the
  `sess` parameter.

- `CodegenContext` no longer needs the `backend_features` field because
  we can use `sess.global_backend_features` instead.

- `CodegenBackend::provide` is now a no-op for all the in-tree backends.
  I haven't removed it because out-of-tree backends still rely on it.
2026-09-16 15:29:44 +10:00
Nicholas Nethercote
81210c9d79 Change CodegenBackend::init to take &mut self
It currently takes `&self`, which is a bit strange for an `init` method.
As a result, the Cranelift and GCC backends have to use types with
interior mutability.

This commit changes it to `&mut self`. Benefits:

- The Cranelift backend can use `Option` instead of `OnceCell` to
  indicate uninit vs. init.

- The GCC backend can avoid `Mutex`, and use `bool` instead of
  `AtomicBool`, which makes things much simpler. The commit also
  restructures `GccCodegenBackend` to mirror `CraneliftCodegenBackend`:
  just contain an `Option<BackendConfig>`, which makes the uninit vs.
  init distinction foolproof. (E.g. no need to set `lto_supported` to
  false and then later overwrite it with the real value.) As part of
  this the `LockedTargetInfo` type is renamed `SharedTargetInfo` because
  that better matches its new internals. (All this compiles both with
  and without the "master" feature set.)
2026-09-16 15:29:44 +10:00
Nicholas Nethercote
51673f89e1 Split build_session
Session creation is currently awkward: we build a mostly-initialized
session, then use it to initialize a codegen backend, and then use the
codegen backend to finish initializing the session.

And it's not just awkward: within the Cranelift backend's `init` method
`sess.lto()` is called, which consults `sess.thin_lto_supported`,
*before* that field has been properly set! In practice it had no effect
but it's worth fixing.

This commit cleans up this mess. It introduces `EarlySession`, which
contains just four `Session` fields, the ones that are needed for
codegen backend initialization. It is now a field within `Session`, and
`Session` derefs to `EarlySession` to avoid changing a zillion
`sess.target`/`sess.opts`/etc. occurrences. `EarlySession` is passed to
`init`, which returns a `CodegenBackendInit` that contains the
backend-specific information needed to build a `Session`. (It replaces
the `replaced_intrinsics`, `fallback_intrinsics`, and
`thin_lto_supported` methods.) The `Session` can then be built in a
single step. No more `Session`/`CodegenBackend` initialization
intermingling.

A few functions that previously took a `Session` now take something
else, e.g. a `Target`. Some `Session` methods are now `EarlySession`
methods. And a new `early_lto` method is used for Cranelift's LTO check.
2026-09-16 15:29:42 +10:00
mejrs
6aaabbb863 compiler: fix bug and span_bug imports 2026-09-15 16:20:18 +02:00
Jonathan Brouwer
305d36bc80 Rollup merge of #162630 - nnethercote:simplify-Diag-G, r=oli-obk
Simplify the `G` in `Diag<'a, G>`

The `EmissionGuarantee` trait isn't necessary, and just complicates things. Details in individual commits.

r? @oli-obk
2026-09-14 15:16:02 +02:00
Zalathar
df15f022ef Disconnect rustc_codegen_ssa from rustc_mir_transform
The direct dependency from `rustc_codegen_ssa` to `rustc_mir_transform` allowed
codegen to reuse some MIR-transform code for identifying unnecessary landing
pads.

However, we can achieve the same result by calling through a hook on `TyCtxt`,
eliminating the crate dependency.
2026-09-12 21:59:29 +10:00
Nicholas Nethercote
09bf6de39e Remove EmissionGuarantee
It's a trait that is used to give `Diag::emit` different return types
depending on the `G` in `Diag<'_, G>`. It works, but it's overkill.
There are only four different `G` types in practice (`BugAbort`,
`FatalAbort`, `ErrorGuaranteed`, and `()`) and having inherent `emit`
methods for each of those four concrete `Diag<'_, G>` types is good
enough.

This commit makes that change. This removes `EmissionGuarantee`
trait bounds from many places, which is nice.
2026-09-12 11:21:03 +10:00
Jonathan Brouwer
7cd747decf Rollup merge of #160023 - antoyo:ssa-indirect-return, r=workingjubilee
Refactor the way cg_ssa handles indirect returns (returns via `sret`) — Take 2

This continues the work that @FractalFir done in rust-lang/rust#144976.

**I managed to make this work, so this confirms the original approach works and is ready to merge.**

r? workingjubilee

(assigning the same reviewer as the original PR)

# The problem

The current way `cg_ssa` handles `PassMode::Indirect` is fundamentally incompatible with the requirements of the GCC backend. This is currently worked around in a very brittle way, that breaks on ARM.

In order to function correctly, `cg_gcc` requires the `sret`(indirect return) pointer to be treated in a special way.

# The solution

This PR separates the `sret` pointer from all the other arguments, allowing each backend to decide how it wants to handle that pointer. This will allow GCC to do it's own thing, while changing nothing on the LLVM side. Currently, the PR just makes both backends preappend the sret arg, mimicking the previous behaviour.

The PR is based on this [zulip suggestion](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Bootstrap.20of.20rustc.20with.20rustc_codegen_gcc/near/526487725).

# Assumptions I made.

The PR makes certain assumptions about the ABI handling.

1. No LLVM intrinsic returns via sret. [According to my sources](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Can.20LLVM.20intrinsics.20return.20via.20PassMode.3A.3AIndirect.3F), this is always true.
2. Tail calls don't currently return via `sret`. From [asking about](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Can.20tail.20calls.20return.20indirectly.28via.20a.20pointer.29.3F/near/532984507), it seems like the tail call handling does not currently support indirect returns. So, I did not add support for that.
3. TLS shims don't perform indirect returns, and asserts and drops also don't perform indirect returns(since they return nothing) - those assumptions seemed reasonable.
4. Inline assembly calls don't use indirect returns. I *assumed* functions like `inline_asm_call` will not need the `sret` handling code. I am not 100% sure about this, tough.
2026-09-11 12:45:02 +02:00
Jacob Pratt
d971af8b59 Rollup merge of #162514 - nnethercote:simplify-diag-Levels, r=oli-obk
Simplify diagnostic levels

This PR separates diagnostic levels from subdiagnostic levels and does a few preliminary cleanups. Details in individual commits.

r? @oli-obk
2026-09-11 00:03:10 -04:00