Commit graph

313531 commits

Author SHA1 Message Date
Matthias Krüger
7180fd1659
Rollup merge of #150051 - Zalathar:thir-pat, r=Nadrieril
mir_build: Rename `TestCase` to `TestableCase`

In the spirit of rust-lang/rust#149946, this is another renaming of something I've always found confusing.

When lowering match conditions, there is a subtle distinction between the kind of *test* being performed (on a scrutinee place), the possible outcomes of that test, and the different “cases” (corresponding to pattern nodes) that the test is distinguishing. Cases imply a particular preferred test, but once a test is chosen it can also interact with other cases as well.

I have often mixed up `TestKind` and `TestCase`, since the names are so similar, and they share several variant names. Therefore, this PR renames `TestCase` to `TestableCase`, to emphasise that these are the things selected by whatever test is being performed.

There should be no change to compiler behaviour.
2025-12-17 18:46:17 +01:00
Matthias Krüger
5fb00f2f28
Rollup merge of #149919 - GuillaumeGomez:doc-metadata-encoding, r=lqd
Correctly encode doc attribute metadata

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

The change I made was slightly wrong. [Originally](https://github.com/rust-lang/rust/pull/149645/changes#diff-72bf3e63aae0c5f24a5ce78a560db321ac6ead9df5ada3e33462a7f7d6218a55) the check was:

```rust
        if let Some(item_list) = attr.meta_item_list() {
            for item in item_list {
                if !item.has_name(sym::inline) {
```

So we were checking that there was no `doc(inline)` attribute. This PR should fix it.

r? ``@lqd``
2025-12-17 18:46:17 +01:00
bors
68f11a11b6 Auto merge of #150089 - JonathanBrouwer:rollup-9nmxze1, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#150008 (Implement va_arg for Hexagon targets)
 - rust-lang/rust#150044 (Avoid unhelpful suggestion when crate name is invalid)
 - rust-lang/rust#150086 (Port `#[rustc_never_returns_null_ptr]` to attribute parser)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-17 13:55:36 +00:00
Jonathan Brouwer
84d441f558
Rollup merge of #150086 - Bryntet:parse_never_return_null_pointer, r=JonathanBrouwer
Port `#[rustc_never_returns_null_ptr]` to attribute parser

Ports `#[rustc_never_returns_null_ptr]` to be parsed using the attribute parser

r? `@JonathanBrouwer`
2025-12-17 12:49:22 +01:00
Jonathan Brouwer
093d175edd
Rollup merge of #150044 - workingjubilee:avoid-suggesting-irrelevant-rename, r=jieyouxu
Avoid unhelpful suggestion when crate name is invalid

Pointing out they can set the crate's name is non-actionable: their problem is they found out how and set it incorrectly. Remove extraneous information that can only confuse the matter.
2025-12-17 12:49:21 +01:00
Jonathan Brouwer
56c00b0bca
Rollup merge of #150008 - androm3da:bcain/va_arg_rs, r=folkertdev
Implement va_arg for Hexagon targets

Implements proper variadic argument handling for hexagon-unknown-linux-musl targets using a 3-pointer VaList structure compatible with LLVM's HexagonBuiltinVaList implementation.

* Handles register save area vs overflow area transition
* Provides proper 4-byte and 8-byte alignment for arguments
* Only activates for hexagon+musl targets via Arch::Hexagon & Env::Musl
2025-12-17 12:49:20 +01:00
Edvin Bryntesson
5692064521
Port #[rustc_never_returns_null_ptr] to attribute parser 2025-12-17 12:35:32 +01:00
bors
f2c70877a7 Auto merge of #150057 - nikic:update-llvm-21.1.8, r=cuviper
Update to LLVM 21.1.8

Fixes https://github.com/rust-lang/rust/issues/149522.
2025-12-17 10:40:46 +00:00
bors
58b270bebe Auto merge of #150080 - tgross35:update-builtins, r=tgross35
compiler-builtins subtree update

Subtree update of `compiler-builtins` to 8a3e35ba82.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-12-17 07:25:39 +00:00
Juho Kahala
a9fa80ce91
Fix expm1f overflow threshold
Due to an erroneous overflow threshold, `expm1f` was incorrectly
returning `inf` for inputs in the range `[88.72169, 88.72283]`. This
additionally caused `sinhf` to return `NaN` for inputs in that range.

The bug was ported from the original in musl, which has since been fixed
in [1].

[1]: https://git.musl-libc.org/cgit/musl/commit/?id=964104f9f0e056cf58d9defa0b716d7756f040f6
2025-12-17 05:56:45 +00:00
Juho Kahala
5faeb43a5c
remove uses of Ord::clamp in scalbn (#1047)
Avoid using `Ord::clamp` in the `f16`-specific part of the generic
`scalbn`.

It turned out to be redundant anyway, as both callsites follow a pattern
like
```
if n < negative_val {
    let foo = (n + positive_val).clamp(negative_val, positive_val);
}
```
and `n < negative_val < 0` implies `n + positive_val < positive_val`.

Fixes: rust-lang/compiler-builtins#1046
2025-12-17 05:56:27 +00:00
quaternic
bd06672d1a apply the rename to aarch64_outline_atomics in builtins-test 2025-12-17 05:01:44 +00:00
The rustc-josh-sync Cronjob Bot
18067a7fc8 Merge ref '2dc30247c5' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 2dc30247c5
Filtered ref: dab12aee0f52f7b83cc62ae565855c731bed502f
Upstream diff: 47cd7120d9...2dc30247c5

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-17 04:58:31 +00:00
The rustc-josh-sync Cronjob Bot
fe791619d0 Prepare for merging from rust-lang/rust
This updates the rust-version file to 2dc30247c5.
2025-12-17 04:56:18 +00:00
Jubilee Young
25cc98f116 Avoid unhelpful suggestion when crate name is invalid
Pointing out they can set the crate's name is non-actionable:
their problem is they found out how and set it incorrectly.
Remove extraneous information that can only confuse the matter.
2025-12-16 20:43:26 -08:00
Brian Cain
4ff4b255d0 fixup! Implement va_arg for Hexagon Linux musl targets 2025-12-16 22:26:19 -06:00
bors
ec6f62244c Auto merge of #150079 - jhpratt:rollup-iehzejf, r=jhpratt
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#150000 (Port `#[rustc_legacy_const_generics]` to use attribute parser )
 - rust-lang/rust#150060 (autodiff: emit an error if we fail to find libEnzyme)
 - rust-lang/rust#150070 (Partially revert rust-lang/rust#147888 and print warning if LLVM CMake dir is missing when building Enzyme)
 - rust-lang/rust#150072 (Port #[no_link] to use attribute parser)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-17 04:13:48 +00:00
Jacob Pratt
656d4e8a96
Rollup merge of #150072 - Bryntet:parse_no_link, r=JonathanBrouwer
Port #[no_link] to use attribute parser

Adds `#[no_link]` to the attribute parser, as well as adds tests making sure to FCW warn on `field`, `arm`, and `macrodef `
2025-12-16 23:10:12 -05:00
Jacob Pratt
1a7df03f58
Rollup merge of #150070 - Kobzol:enzyme-error, r=ZuseZ4
Partially revert #147888 and print warning if LLVM CMake dir is missing when building Enzyme

Partially reverts https://github.com/rust-lang/rust/pull/147888, Enzyme cannot be build with `download-ci-llvm = true`.

r? ``@ZuseZ4``
2025-12-16 23:10:11 -05:00
Jacob Pratt
641100c391
Rollup merge of #150060 - ZuseZ4:autodiff-dlopen-ice, r=Kobzol
autodiff: emit an error if we fail to find libEnzyme

Tested manually by moving libEnzyme-21.so away. We should adjust the error msg. once we have the component up.

It's the first usage within rustc of this experimental feature, but afaik we're open to dogfooding those for test purpose, right?

r? ``@Kobzol``
2025-12-16 23:10:10 -05:00
Jacob Pratt
66155a7df6
Rollup merge of #150000 - Bryntet:brynte/parse_legacy_const_generic_args, r=jonathanbrouwer,jdonszelmann
Port `#[rustc_legacy_const_generics]` to use attribute parser

Small PR that ports the `#[rustc_legacy_const_generics]` to use the new attribute parser!

r? JonathanBrouwer
2025-12-16 23:10:10 -05:00
Edvin Bryntesson
b09a9d0062
add tests making sure to FCW warn on field, arm, and macro def 2025-12-16 22:45:56 +01:00
Edvin Bryntesson
52bcaabdb8
Port #[no_link] to use attribute parser 2025-12-16 22:45:32 +01:00
Jakub Beránek
7463b15044
Print warning if LLVM CMake directory does not exist 2025-12-16 22:01:16 +01:00
Jakub Beránek
6847bd0fac
Revert 147888 2025-12-16 21:59:39 +01:00
Manuel Drehwald
793d990d11 Emit a proper error if we fail to find libEnzyme 2025-12-16 21:33:28 +01:00
bors
2dc30247c5 Auto merge of #150068 - JonathanBrouwer:rollup-45j7puz, r=JonathanBrouwer
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#147939 (Make `const BorrowMut` require `const Borrow` and make `const Fn` require `const FnMut`)
 - rust-lang/rust#149734 (Mirror GCC 9.5.0)
 - rust-lang/rust#149767 (Tidying up tests/ui/issues 33 tests [4/N])
 - rust-lang/rust#149804 (chore: fix some minor issues in the comments)
 - rust-lang/rust#149967 (custom `VaList` layout for Hexagon)
 - rust-lang/rust#150025 (dont create unnecessary `DefId`s under mgca)
 - rust-lang/rust#150032 (Use annotate-snippet as default emitter on stable)
 - rust-lang/rust#150033 (Add try_as_dyn and try_as_dyn_mut)
 - rust-lang/rust#150042 (rustc-dev-guide subtree update)
 - rust-lang/rust#150063 (Remove deny of manual-let-else)
 - rust-lang/rust#150064 (std: io: error: Add comment for UEFI unpacked repr use)

Failed merges:

 - rust-lang/rust#150044 (Avoid unhelpful suggestion when crate name is invalid)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-16 19:46:35 +00:00
Edvin Bryntesson
4bd0e65bde
Port #[rustc_legacy_const_generics] to use attribute parser 2025-12-16 20:29:01 +01:00
Jonathan Brouwer
ff84058781
Rollup merge of #150064 - Ayush1325:uefi-io-repr-comment, r=bjorn3
std: io: error: Add comment for UEFI unpacked repr use

The following commit adds the comment explaining the rational why UEFI uses unpacked representation on 64-bit platforms as opposed to bit-packed representation used in all other 64-bit platforms.

r? `@bjorn3`
2025-12-16 20:21:13 +01:00
Jonathan Brouwer
02c0e8f015
Rollup merge of #150063 - workingjubilee:remove-let-else-deny, r=Kivooeo
Remove deny of manual-let-else

During discussion on Zulip[^1], we found there was no strong consensus in favor of this in practice.

[^1]: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/.60deny.28clippy.3A.3Amanual_let_else.29.60.20proliferation/with/564085588
2025-12-16 20:21:12 +01:00
Jonathan Brouwer
926c2e6339
Rollup merge of #150042 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to 326e590ad8.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-12-16 20:21:11 +01:00
Jonathan Brouwer
25b73c4943
Rollup merge of #150033 - izagawd:try_as_dyn, r=oli-obk
Add try_as_dyn and try_as_dyn_mut

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

Continuation of: https://github.com/rust-lang/rust/pull/144363
2025-12-16 20:21:10 +01:00
Jonathan Brouwer
f3fa567fdf
Rollup merge of #150032 - Kivooeo:annotate-snippets-stable, r=Muscraft
Use annotate-snippet as default emitter on stable

This is implementation of https://github.com/rust-lang/rust/issues/149932

Now, after MCP was accepted, we can use annotate-snippet as default emitter for errors, that means that we not longer need of previous emitter, so this PR removed previous emitter and makes annotate-snippet new default one both on stable and nightly

(this PR does not remove a code of previous emitter it just removes a `Default` option of `HumanReadableErrorType` enum, and keeping only `HumanReadableErrorType::AnnotateSnippet` as it now uses by default)
2025-12-16 20:21:10 +01:00
Jonathan Brouwer
9308518af9
Rollup merge of #150025 - BoxyUwU:mgca_no_unused_defids, r=oli-obk
dont create unnecessary `DefId`s under mgca

Fixes rust-lang/rust#149977
Fixes rust-lang/rust#148838

Accidentally left this out of rust-lang/rust#149136 even though being able to do this was a large part of the point of the PR :3

First ICE was caused by the fact that we create a defid but never lower the nodeid associated with it to a hirid which later parts of the compiler can't handle.

See test for second ICE

r? oli-obk
2025-12-16 20:21:09 +01:00
Jonathan Brouwer
ef2c71c3cc
Rollup merge of #149967 - folkertdev:va-list-hexagon, r=workingjubilee
custom `VaList` layout for Hexagon

I noticed while browsing LLVM source that we use an incorrect `VaList` definition for the musl hexagon target.

relevant links

- 0cdc1b6dd4/clang/include/clang/Basic/TargetInfo.h (L333)
- 0cdc1b6dd4/clang/lib/CodeGen/Targets/Hexagon.cpp (L407-L417)

cc target maintainer `@androm3da` can you confirm that this looks OK? In particular the `#[rustc_pass_indirectly_in_non_rustic_abis]` attribute is used to simulate pointer decay (like if the struct were wrapped in a 1-element array in C). The clang comment suggests that the Tag is wrapped in such a single-element array, but I haven't actually been able to confirm it.

For stabilizing `c_variadic` (on the hexagon targets) we will also need a custom `va_arg` implementation to mirror the one in `clang` in [va_arg.rs](https://github.com/rust-lang/rust/blob/main/compiler/rustc_codegen_llvm/src/va_arg.rs). Would you be able to contribute one?

r? `@workingjubilee`
2025-12-16 20:21:08 +01:00
Jonathan Brouwer
297cdc8137
Rollup merge of #149804 - xiaolinny:main, r=lcnr
chore: fix some minor issues in the comments

fix some minor issues in the comments
2025-12-16 20:21:08 +01:00
Jonathan Brouwer
f108cd7232
Rollup merge of #149767 - reddevilmidzy:t11, r=Kivooeo
Tidying up tests/ui/issues 33 tests [4/N]

> [!NOTE]
> Intermediate commits are intended to help review, but will be squashed add comment commit prior to merge.

part of rust-lang/rust#133895

`tests/ui/compile-flags` split it into `tests/ui/compile-flags/invalid/` and `tests/ui/compile-flags/run-pass/`

r? Kivooeo
2025-12-16 20:21:07 +01:00
Jonathan Brouwer
6c7ee7d84a
Rollup merge of #149734 - Kobzol:gcc-9.2.0, r=marcoieni
Mirror GCC 9.5.0

The GCC servers can be unreliable.

r? `@marcoieni`
2025-12-16 20:21:06 +01:00
Jonathan Brouwer
d93b93bcb0
Rollup merge of #147939 - theemathas:add-const-supertrait, r=oli-obk
Make `const BorrowMut` require `const Borrow` and make `const Fn` require `const FnMut`

This makes it consistent with other const traits in the standard library with supertraits.

I am currently unsure if `const FnMut` should require `const FnOnce` or not. See [zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/.5Bconst.5D.20implied.20bounds.20for.20implicit.20trait.20bounds/near/546152748).
2025-12-16 20:21:05 +01:00
Ayush Singh
4efe2681f7
std: io: error: Add comment for UEFI unpacked repr use
The following commit adds the comment explaining the rational why UEFI
uses unpacked representation on 64-bit platforms as opposed to bit-packed
representation used in all other 64-bit platforms.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-12-16 22:27:42 +05:30
Jubilee Young
0004d8d421 Remove deny of manual-let-else 2025-12-16 08:42:04 -08:00
bors
31010ca61c Auto merge of #149442 - chenyukang:yukang-fix-mark-span-note-144304, r=estebank
Fix span note for question mark expression

Fixes rust-lang/rust#144304

Seems it's better to fix the note instead of modifying the span to cover the whole expression.

r? `@estebank`
2025-12-16 16:06:43 +00:00
Kivooeo
84f2854bc3 remove fixme & update stderr files 2025-12-16 13:23:48 +00:00
Kivooeo
a47c8b292e remove human-annotate-rs 2025-12-16 13:23:45 +00:00
bors
95a27adcf9 Auto merge of #143924 - davidtwco:sve-infrastructure, r=workingjubilee
`rustc_scalable_vector(N)`

Supercedes rust-lang/rust#118917.

Initial experimental implementation of rust-lang/rfcs#3838. Introduces a `rustc_scalable_vector(N)` attribute that can be applied to types with a single `[$ty]` field (for `u{16,32,64}`, `i{16,32,64}`, `f{32,64}`, `bool`). `rustc_scalable_vector` types are lowered to scalable vectors in the codegen backend.

As with any unstable feature, there will necessarily be follow-ups as we experiment and find cases that we've not considered or still need some logic to handle, but this aims to be a decent baseline to start from.

See rust-lang/rust#145052 for request for a lang experiment.
2025-12-16 12:53:53 +00:00
Zalathar
7f6f522761 Rename TestCase to TestableCase 2025-12-16 22:40:05 +11:00
Nikita Popov
f33abb17db Update to LLVM 21.1.8 2025-12-16 12:32:00 +01:00
Kivooeo
6d6068f6c5 stabilize annotate-snippet as default formatter 2025-12-16 11:20:27 +00:00
David Wood
f0dfeab43d
abi: Display bound on TyAbiInterface
The `fmt::Debug` impl for `TyAndLayout<'a, Ty>'` requires `fmt::Display`
on the `Ty` parameter. In `ArgAbi`, `TyAndLayout`'s Ty` is instantiated
with a parameter that implements `TyAbiInterface`. `TyAbiInterface`
only required `fmt::Debug` be implemented on `Self`, not `fmt::Display`,
which meant that it wasn't actually possible to debug print `ArgAbi`.
2025-12-16 11:01:26 +00:00
David Wood
5f27abdbc8
mono: require target feature for scalable vectors
Scalable vector types only work with the relevant target features
enabled, so require this for any function with the types in its
signature.
2025-12-16 11:01:26 +00:00