Commit Graph

342279 Commits

Author SHA1 Message Date
Jonathan Brouwer
304792b877 Rollup merge of #163561 - durin42:llvm-24-extra-noundefs, r=nikic
tests: accept noundef in a couple more places

LLVM 24 got smarter and is able to mark some more things noundef, which showed up in some of our test checks.

@rustbot label: +llvm-main
2026-10-03 12:22:29 +02:00
Jonathan Brouwer
57373cd158 Rollup merge of #163454 - Tehforsch:fix-lifetime-preceding-type-in-generics, r=JonathanBrouwer
Improve suggestion for lifetime preceding type in generics

Closes rust-lang/rust#59325

Specifically, this fixes cases like the 2nd example in the issue, where a lifetime precedes a type in generic args:
`Foo<'static T1>` and suggests either adding a reference, i.e. `Foo<&'static T1>` or a comma, i.e. `Foo<'static, T1>`.

In a case like `Foo<'static mut T1>`, only `Foo<&'static mut T1>` is suggested.
2026-10-03 12:22:28 +02:00
Jonathan Brouwer
df410a2ac9 Rollup merge of #163663 - yara-blue:reflection-ice-typeid-info, r=oli-obk
reflection: fix ICE when TypeId::info called on ADT

We are refactoring from a large enum where the fields of the variants contain all the reflection info to a flat enum containing only the type kind (struct/bool/array etc). While we removed the fields of Struct, Enum and Union we forgot to take out the const eval code writing into those fields. That gave an ICE. This fixes that.
2026-10-03 12:22:27 +02:00
Jonathan Brouwer
4f58d34847 Rollup merge of #163645 - lcnr:ui-tests-compare-mode, r=jackh726
add `ignore-compare-mode-next-solver` to all next-solver tests

Adds `//@ ignore-compare-mode-next-solver (explicit revisions)` to all next-solver revision tests. Used an LLM to automate this and did a self-review. Can recommend only looking at `.rs` files.
2026-10-03 12:22:26 +02:00
lcnr
5d332db346 add ignore-compare-mode-next-solver and change order to be consistent 2026-10-03 10:27:40 +02:00
bors
b6e4b5c4e9 Auto merge of #163680 - JonathanBrouwer:rollup-L685mEZ, r=JonathanBrouwer
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#163655 (explicitly handle tests that pass with -Znext-solver)
 - rust-lang/rust#159924 (Send -fno-lto when linker plugin LTO is not requested to avoid having GCC do LTO when using rustc_codegen_gcc)
 - rust-lang/rust#163572 (Update the minimum external LLVM to 22)
 - rust-lang/rust#129822 (Docs - type guarantees update)
 - rust-lang/rust#157973 (Distinguish `repr(C)` ZSTs from others in ABI compatibility rules)
 - rust-lang/rust#162332 (preserve overflow in builtin Field candidates)
 - rust-lang/rust#163574 (intrinsics: Rename `abort` to `abort_immediate`)
 - rust-lang/rust#163638 (avoid trivial `fn map_bound` validations)
 - rust-lang/rust#163660 (yeet compare-mode-coherence)
2026-10-03 03:15:41 +00:00
bors
e0452e266c Auto merge of #163628 - nnethercote:SourceSpanCache, r=oli-obk
Add a single-entry parent `SpanData` cache

For use in encoding, decoding, and stable hashing. It's a decent performance win on a number of benchmarks.

r? @oli-obk
2026-10-03 00:09:31 +00:00
Jonathan Brouwer
d1db444d9d Rollup merge of #163660 - lcnr:compare-mode, r=lqd
yeet compare-mode-coherence

`-Znext-solver=coherence` is stable
2026-10-02 22:39:50 +02:00
Jonathan Brouwer
242c2f4d09 Rollup merge of #163638 - lcnr:map-bound-no-validate, r=oli-obk
avoid trivial `fn map_bound` validations

when compiling `zerocopy` a lot of time is spent simply checking the bound vars in `Clause::kind` because it does
```rust
        self.0.internee.map_bound(|kind| match kind {
            PredicateKind::Clause(clause) => clause,
            _ => unreachable!(),
        })
```
let's make performance with `debug_assertions` a bit better:

`zerocopy` with `-Znext-solver`:
```
16884862 counts
(  1) 12189626 (72.2%, 72.2%): Binder::map_bound called at compiler/rustc_middle/src/ty/predicate.rs:174:25
(  2)  1853971 (11.0%, 83.2%): Binder::map_bound called at compiler/rustc_type_ir/src/binder.rs:89:14
(  3)  1443803 ( 8.6%, 91.7%): Binder::map_bound called at compiler/rustc_type_ir/src/inherent.rs:493:14
(  4)   572570 ( 3.4%, 95.1%): Binder::map_bound called at compiler/rustc_type_ir/src/predicate.rs:234:14
(  5)   272733 ( 1.6%, 96.7%): Binder::map_bound called at compiler/rustc_type_ir/src/inherent.rs:507:14
(  6)   184934 ( 1.1%, 97.8%): Binder::map_bound called at compiler/rustc_middle/src/ty/predicate.rs:523:14
(  7)   183998 ( 1.1%, 98.9%): Binder::map_bound called at compiler/rustc_type_ir/src/predicate.rs:251:14
```
`zerocopy` with `-Znext-solver=no`
```
13476410 counts
(  1)  9906183 (73.5%, 73.5%): Binder::map_bound called at compiler/rustc_middle/src/ty/predicate.rs:174:25
(  2)  2107825 (15.6%, 89.1%): Binder::map_bound called at compiler/rustc_type_ir/src/binder.rs:89:14
(  3)   376524 ( 2.8%, 91.9%): Binder::map_bound called at compiler/rustc_type_ir/src/inherent.rs:493:14
(  4)   321976 ( 2.4%, 94.3%): Binder::map_bound called at compiler/rustc_type_ir/src/predicate.rs:251:14
(  5)   262305 ( 1.9%, 96.3%): Binder::map_bound called at compiler/rustc_middle/src/ty/predicate.rs:523:14
(  6)    84143 ( 0.6%, 96.9%): Binder::map_bound called at compiler/rustc_infer/src/infer/outlives/verify.rs:49:47
(  7)    83876 ( 0.6%, 97.5%): Binder::map_bound called at compiler/rustc_infer/src/traits/mod.rs:183:24
```
compiling `std`:
```
32803629 counts
(  1) 12234204 (37.3%, 37.3%): Binder::map_bound called at compiler/rustc_type_ir/src/binder.rs:89:14
(  2)  9624749 (29.3%, 66.6%): Binder::map_bound called at compiler/rustc_middle/src/ty/predicate.rs:174:25
(  3)  3805442 (11.6%, 78.2%): Binder::map_bound called at compiler/rustc_type_ir/src/inherent.rs:493:14
(  4)  2542468 ( 7.8%, 86.0%): Binder::map_bound called at compiler/rustc_type_ir/src/predicate.rs:234:14
(  5)  1229480 ( 3.7%, 89.7%): Binder::map_bound called at compiler/rustc_middle/src/ty/predicate.rs:523:14
(  6)  1176716 ( 3.6%, 93.3%): Binder::map_bound called at compiler/rustc_type_ir/src/predicate.rs:251:14
(  7)   385823 ( 1.2%, 94.5%): Binder::map_bound called at compiler/rustc_type_ir/src/inherent.rs:507:14
```
Could spend more effort to avoid the validation in trivial `Binder::fold_with`, but that's not worth it I think.

cc https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/casual.20chat.20and.20support/near/628479010
2026-10-02 22:39:49 +02:00
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
Jonathan Brouwer
bb9cac2bf6 Rollup merge of #162332 - amirHdev:fix-field-projection-overflow, r=lcnr
preserve overflow in builtin Field candidates

preserve overflow from the builtin Field candidate instead of treating it as `NoSolution`
the Sized requirements are now evaluated inside the candidate probe and coherence correctly rejects overlapping impls when evaluation overflows.

fixes rust-lang/rust#162125
2026-10-02 22:39:47 +02:00
Jonathan Brouwer
3bcfbadbc0 Rollup merge of #157973 - Jules-Bertholet:distinguish-c-zst-docs, r=RalfJung
Distinguish `repr(C)` ZSTs from others in ABI compatibility rules

FCP: https://github.com/rust-lang/rust/pull/157973#issuecomment-4984495034

(Split out from compiler implementation in https://github.com/rust-lang/rust/pull/156112)

Some C ABIs pass and return ZSTs by pointer. But `()` should never be returned by pointer, as it must match `void`. To account for this, we have to weaken the present guarantee of "any two types with size 0 and alignment 1 are ABI-compatible" to exclude `repr(C)`.

[t-lang nomination summary comment](https://github.com/rust-lang/rust/pull/157973#issuecomment-4866823377)

Fixes rust-lang/unsafe-code-guidelines#552; see also rust-lang/rust#78586, rust-lang/rust#155299.
Also related to https://github.com/rust-lang/rust/pull/155984.

@rustbot label T-lang A-ABI needs-fcp
2026-10-02 22:39:46 +02:00
Jonathan Brouwer
764a91cad2 Rollup merge of #129822 - WiktorPrzetacznik:docs-guarantees-update, r=clarfonthey
Docs - type guarantees update

**Content:**
- Pin::map_unchecked | Safety section update
- String::reserve, String::reserve_exact | Panic section update
- Saturating | Introduce Layout section
- Fix typos

**Questions:**

1. This proposes to update String reserve methods docs:

    > Panics if the new capacity overflows [`usize`].

    ->

    > Panics if the new capacity exceeds [`isize::MAX`] bytes.

    There are a few other types that are based on Vec and offer similar reserve API (like BinaryHeap).
    Should they be updated, too?

ACP: ~~https://github.com/rust-lang/libs-team/issues/482~~ [not required]
2026-10-02 22:39:45 +02:00
Jonathan Brouwer
e70aee9ec7 Rollup merge of #163572 - cuviper:min-llvm-22, r=nikic
Update the minimum external LLVM to 22

With this change, we'll have stable support for LLVM 22 and 23.
For reference, the previous increase to LLVM 21 was rust-lang/rust#153684.

cc @rust-lang/wg-llvm @durin42
r? nikic
2026-10-02 22:39:44 +02:00
Jonathan Brouwer
adb158408e Rollup merge of #159924 - antoyo:fix/fno-lto, r=bjorn3
Send -fno-lto when linker plugin LTO is not requested to avoid having GCC do LTO when using rustc_codegen_gcc

More info on [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Add.20linker.20flag.20from.20the.20codegen/near/375045533).

cc @bjorn3
2026-10-02 22:39:43 +02:00
Jonathan Brouwer
220201e2e1 Rollup merge of #163655 - lcnr:next-solver-pass-tests, r=lqd
explicitly handle tests that pass with -Znext-solver

these are all UI tests which pass with the new solver and fail with old. Using explicit revisions here.

Editing some of them to actually test what they should 😁
2026-10-02 22:39:42 +02:00
Yara
da0baa24c4 reflection: fix ICE when TypeId::info called on ADT
We are refactoring from a large enum where the fields of the variants
contain all the reflection info to a flat enum containing only the type
kind (struct/bool/array etc). While we removed the fields of Struct,
Enum and Union we forgot to take out the const eval code writing into
those fields. That gave an ICE. This fixes that.
2026-10-02 22:32:46 +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
bors
0abfedbc7c Auto merge of #163661 - JonathanBrouwer:rollup-OaJ1qun, r=JonathanBrouwer
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#163582 (Reapply "bootstrap: Enable rustdoc mergeable CCI for std and internal docs")
 - rust-lang/rust#151793 (Add mul_add_relaxed methods for floating-point types)
 - rust-lang/rust#162782 (Fix rustdoc ICE caused by mishandling of ambiguity errors)
 - rust-lang/rust#163010 (Miri can do dirfd now)
 - rust-lang/rust#163535 (Improve `DocStrings` perf)
 - rust-lang/rust#163576 (Fix `TypeOutlives` fast-path)
 - rust-lang/rust#163587 (Several small span improvements)
 - rust-lang/rust#163603 (Reorganise reflection intrinsics)
 - rust-lang/rust#163612 (fix `ValidateBoundVars`)
 - rust-lang/rust#163632 (bump rustc-build-sysroot)
 - rust-lang/rust#163635 (Revert note about signum of NaN)
 - rust-lang/rust#163644 (Add mailmap entry)
 - rust-lang/rust#163647 (Rename `rustc_driver::run_compiler` to `compiler_entrypoint`)
 - rust-lang/rust#163651 (Remove variants from `feature-gate-autodiff-use` test)
2026-10-02 17:17:37 +00:00
Josh Stone
c76b523860 Update the minimum external LLVM to 22
Co-authored-by: Augie Fackler <augie@google.com>
2026-10-02 09:21:16 -07:00
lcnr
df07926739 explicitly handle tests that pass with -Znext-solver
Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com>
2026-10-02 15:42:30 +00:00
Amirhossein Akhlaghpour
01ad9b75b1 update Field UI stderr after diagnostic change
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
2026-10-02 18:45:48 +03:30
Amirhossein Akhlaghpour
a785a9fbc1 make Field base kind invariant explicit
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
2026-10-02 18:37:46 +03:30
Amirhossein Akhlaghpour
180aa923c5 preserve overflow in builtin Field candidates
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
2026-10-02 18:37:46 +03:30
lcnr
bc1da7a1e3 yeet compare-mode-coherence 2026-10-02 16:24:24 +02:00
Jonathan Brouwer
f784deb0b7 Rollup merge of #163651 - Kobzol:feature-autodiff, r=jieyouxu
Remove variants from `feature-gate-autodiff-use` test

Both the stable and nightly variants were the same; the test didn't actually test what it thought, because compiletest enables `RUSTC_BOOTSTRAP=1` unconditionally.

CC @ZuseZ4

r? jieyouxu
2026-10-02 16:08:19 +02:00
Jonathan Brouwer
b624ec2764 Rollup merge of #163647 - blyxyas:change-run_compiler-to-compiler_entrypoint, r=oli-obk
Rename `rustc_driver::run_compiler` to `compiler_entrypoint`

Having two `run_compiler` functions has always been confusing and not necessary at all, as they perform fairly different functions. Even more so because `rustc_driver::run_compiler` calls to `rustc_interface::run_compiler`. So it seems like a recursive function when it really isn't.
2026-10-02 16:08:18 +02:00
Jonathan Brouwer
da54cdda2c Rollup merge of #163644 - Kobzol:austin-k-mailmap, r=jieyouxu
Add mailmap entry

Done at the request of the user.

CC @lorilorusso
2026-10-02 16:08:17 +02:00
Jonathan Brouwer
8c897a9508 Rollup merge of #163635 - Darksonn:signum-nan, r=RalfJung
Revert note about signum of NaN

See: https://github.com/rust-lang/rust/pull/162576#discussion_r4163739016
2026-10-02 16:08:16 +02:00
Jonathan Brouwer
f82326343e Rollup merge of #163632 - RalfJung:miri-build-sysroot, r=oli-obk
bump rustc-build-sysroot

Fixes https://github.com/rust-lang/miri/issues/5371

r? @oli-obk
2026-10-02 16:08:15 +02:00
Jonathan Brouwer
211f337692 Rollup merge of #163612 - lcnr:fix-validate-bound-vars, r=oli-obk
fix `ValidateBoundVars`

`ControlFlow::Break` is just wrong. We want to visit later types even if we skip the current one.

The `t.outer_exclusive_binder() <= self.binder_index` check is more subtle. See the flag computation

29df41c471/compiler/rustc_type_ir/src/flags.rs (L217-L218)

It is the exclusive binder. The first binder for which there exist no bound vars. This is subtle and was found while asking an LLM to help with perrrrf, only for me to then be confused for 10 min while checking whether this is right :<

r? types
2026-10-02 16:08:14 +02:00
Jonathan Brouwer
3951fd6816 Rollup merge of #163603 - yara-blue:reflection-reorder, r=oli-obk
Reorganise reflection intrinsics

Trivial refactor moving some things around.

We got a fair amount of intrinsics for reflection now with more on the way. At this point it's worth it to reorganize things a little. This prefixes them with `type_id_` (`TypeId` is the entry point for _nearly_ all of reflection) and moves their declaration into its own module (`core::intrinsics::reflection`).

Possible contentious is the move of the `type_id` intrinsic which has existed for a while and was previously at `core::intrinsics::type_id`. It is still unstable and as far as I am aware intrinsics should really not be relied upon by users.

I've decided to leave the `field_representing_field` (name, offset, actual_type_of) where they are since those where not created for reflection and will be changed in the future (see: https://github.com/rust-lang/rust/issues/162127).

r? oli-obk
2026-10-02 16:08:13 +02:00
Jonathan Brouwer
3fa7cd22dc Rollup merge of #163587 - nnethercote:small-span-improvements, r=petrochenkov
Several small span improvements

Limit changes:
- Increase `MAX_CTXT`: it is currently `0b0111_1111_1111_1110` (~15 bits). But it only needs to be distinguishable from `CTXT_INTERNED_MARKER` (all 1s). So we can increase it to `0b1111_1111_1111_1110` (~16 bits). The old limit is rarely reached; the `uom` crate is an exception (it has 39k contexts) and we see a 1-2% instruction count reduction when building it. (This value was incorrectly reduced from ~16 bits to ~15 bits in e525e4f10a by me; apologies!)

Renamings:
- Rename `MAX_CTXT` as `MAX_CTXT_OR_PARENT` because it also relates to the parent field.
- Remove the `BASE_` prefix from `BASE_LEN_INTERNED_MARKER` because it doesn't mean anything.

Comments:
- Update parts of the comment that predate the addition of the `parent` field, such as the frequency measurements. (In incremental builds, 20-40% internment due to non-root context and non-zero parent is common.)
- Slightly clarify the meanings of the fields in the different forms, and add a paragraph quickly explaining which specific values distinguish the four forms.

r? @petrochenkov
2026-10-02 16:08:12 +02:00
Jonathan Brouwer
12e214aa4f Rollup merge of #163576 - ShoyuVanilla:outlives-fast-path, r=lcnr
Fix `TypeOutlives` fast-path

> Oh, the fast path is scuffed here. So, I feel fairly confident that we can encounter cases where stalled_on is wrong due to region vars without there being a bug, as in, your change is correct and desirable, but this specific test is just a bug in the fast path:
>
> `<MaybeVerify as Service<?infer>>::Future: 'static` should simply not be considered stalled. What's the cost of either entirely removing this trivially_stalled_on fast path or fixing it to bail when encountering non-rigid aliases
>
> This change is correct. Please separately do a PR to fix the type-outlives fastpath 😊

_Originally posted by @lcnr in https://github.com/rust-lang/rust/issues/162782#issuecomment-5920951094_

The first perf-run result is for always returning `Outcome::NoFastPath` on any infer var and the second one is for the current HEAD.

We shouldn't stall the outlives goal if the goal contains a non-rigid alias even though the goal contains a non-region infer. Non-fast path will normalize that non-rigid alias and that make the evaluation progress, and I think in theory the fast path shouldn't make observable difference outside the solver.

I'm not entirely sure on disabling fast path only in the presence of non-rigid opaques instead of disabling it entirely for non-region infer, but..

- It's no-less-correct than the status quo
- It roughly matches the actual non-fast path:
  dba8825fe5/compiler/rustc_next_trait_solver/src/solve/mod.rs (L128-L129)
- The later has some perf impact hard to ignore for `typenum`

I couldn't conjure up any case fixed by this PR other than the one in https://github.com/rust-lang/rust/pull/162782 😅

r? lcnr
2026-10-02 16:08:11 +02:00
Jonathan Brouwer
12ea9e3951 Rollup merge of #163535 - GuillaumeGomez:improve-doc-strings-perf, r=nnethercote
Improve `DocStrings` perf

Follow-up of rust-lang/rust#162862.

r? ghost
2026-10-02 16:08:09 +02:00
Jonathan Brouwer
41459a629b Rollup merge of #163010 - RalfJung:unix-dir-entry, r=Mark-Simulacrum
Miri can do dirfd now

So let's remove some special-casing from the standard library.

Fixes https://github.com/rust-lang/miri/issues/5327
2026-10-02 16:08:09 +02:00
Jonathan Brouwer
0d660279e9 Rollup merge of #162782 - ShoyuVanilla:issue-162557, r=lcnr
Fix rustdoc ICE caused by mishandling of ambiguity errors

Fixes rust-lang/rust#162557

```rust
pub trait Service<Request> {
    type Future;
}

pub trait ZebraService<Request>: Service<Request> {}

impl<MaybeVerify, Request> ZebraService<Request> for MaybeVerify where
    MaybeVerify: Service<Request, Future: 'static>
{
}

pub struct Verifier;

impl Service<()> for Verifier {
    type Future = &'static ();
}
```

In the above minimization of the issue, when we try to check whether the blanket impl can be applied to `Verifier`,

a8a1e6fd9d/src/librustdoc/clean/blanket_impl.rs (L42-L67)

We make fresh args for the where-clause and skip normalization for it.

So, we have `<?MaybeVerify as Service<?Request>>::Future: 'static` bound to check. But it immediately evaluated into ambiguity due to stalled on infer vars in the fast path as the obligation contains the infer vars.

But due https://github.com/rust-lang/rust/pull/162182 we evaluated it directly in the solver without `stalled_on` and this time it succeeded because we can normalize the alias into a concrete type `&'static ()` and it outlives the static region.

So, I think it's very iffy to call `InferCtxt::evaluate_obligation` on a non-rigid alias and we should eagerly normalize it in `L67` from the above rustdoc code.
But it may break something in rustdoc as normalizations inside it is pretty messy in general 🫠 So, I guess in another PR with crater runs.

r? lcnr
2026-10-02 16:08:08 +02:00
Jonathan Brouwer
522c673572 Rollup merge of #151793 - landsharkiest:float_mul_add_relaxed-#151770, r=tgross35
Add mul_add_relaxed methods for floating-point types

Implements mul_add_relaxed for f16, f32, f64, and f128, which computes (self * a) + b with relaxed precision semantics. Unlike mul_add which guarantees a fused operation, this variant allows the compiler to choose between fused or separate operations based on target performance.

This fills the gap between the precision-guaranteed mul_add and the fully-optimizable algebraic operators, providing target-specific optimization while maintaining reasonable floating-point semantics.

Tracking issue: https://github.com/rust-lang/rust/issues/151770

try-job: dist-i586-gnu-i586-i686-musl
2026-10-02 16:08:07 +02:00
Jonathan Brouwer
e370c542bb Rollup merge of #163582 - notriddle:revert-revert-mergeable-cci, r=Kobzol
Reapply "bootstrap: Enable rustdoc mergeable CCI for std and internal docs"

Reverts https://github.com/rust-lang/rust/pull/162339

Re-applies https://github.com/rust-lang/rust/pull/161716 and https://github.com/rust-lang/rust/pull/162318

Since a new beta has been released between then and now, the fix applied in https://github.com/rust-lang/rust/pull/162346 is in beta, so the code should work.

r? @jieyouxu
2026-10-02 16:08:06 +02:00
bors
da51be10c3 Auto merge of #158863 - WaffleLapkin:nonofree, r=RalfJung
Emit llvm dereferenceable in more cases on newer LLVM versions





On llvm >= 23 emit `dereferenceable` even without `nofree`, since https://github.com/llvm/llvm-project/pull/204795 makes `dereferenceable` act "at a point" / not imply `nofree`.

Additionally restrict `dereferenceable` to `&Freeze` / `&mut Unpin` / `Box<Unpin, _>` only (this is only relevant for `llvm >= 23` as otherwise `!Freeze`/`!Unpin` suppress `nofree` and as such `dereferenceable`).

r? nikic

I thought this will be a bit harder change, but since your refactoring in rust-lang/rust#156281 it's actually trivial ^^'

Draft because I don't think this can be tested prior to LLVM update. I'm also not sure if the version check I did is the appropriate one...

cc @RalfJung
2026-10-02 14:08:00 +00:00
Jules Bertholet
fa05b785db Distinguish repr(C) ZSTs from others in ABI compatibility rules
Co-Authored-By: Brian Smith <brian@briansmith.org>
Co-Authored-By: Ralf Jung <post@ralfj.de>
2026-10-02 09:58:31 -04: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
Wiktor Przetacznik
02d1672d5b Introduce layout section in Saturating
Document layout of Saturating, similarly to Wrapping
2026-10-02 15:41:31 +02:00
Wiktor Przetacznik
6e2fd190b2 Fix typo 2026-10-02 15:35:16 +02:00
Yara
9b60c2ad0f reflection: move type_id intrinsics to intrinsics::reflection 2026-10-02 14:05:54 +02:00
Jakub Beránek
60f8e925ce Remove variants from feature-gate-autodiff-use test 2026-10-02 13:33:42 +02:00
Alejandra González
1859636fd0 Change rustc_public run macro to also use compiler_entrypoint 2026-10-02 11:15:22 +00:00
Alejandra González
c39fbc44eb Rename rustc_driver::run_compiler to compiler_entrypoint
Having two `run_compiler` functions has always been confusing and not necessary at all, as they perform fairly different functions. Even more so because `rustc_driver::run_compiler` calls to `rustc_interface::run_compiler`. So it seems like a recursive function when it really isn't.
2026-10-02 12:00:55 +02:00
Jakub Beránek
eb4108a985 Add mailmap entry 2026-10-02 11:47:13 +02:00
Shoyu Vanilla
9270acb1bf Fix TypeOutlives fast-path 2026-10-02 09:37:21 +00:00