Commit graph

312443 commits

Author SHA1 Message Date
Guillaume Gomez
94f1bfe1fc Merge commit 'dab6863ce8' into subtree-update_cg_gcc_2025-12-04 2025-12-04 14:53:08 +01:00
bors
b1b08cdef5 Auto merge of #149631 - matthiaskrgr:rollup-jbx443u, r=matthiaskrgr
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#147841 (Fix ICE when applying test macro to crate root)
 - rust-lang/rust#149147 (Fix unused_assignments false positives from macros)
 - rust-lang/rust#149183 (Use `TypingMode::PostAnalysis` in `try_evaluate_const`)
 - rust-lang/rust#149456 (std: don't call `current_os_id` from signal handler)
 - rust-lang/rust#149501 (CTFE: avoid emitting a hard error on generic normalization failures)
 - rust-lang/rust#149528 (reword error for invalid range patterns)
 - rust-lang/rust#149539 (Additional test for uN::{gather,scatter}_bits)
 - rust-lang/rust#149549 (Regression test for system register `ttbr0_el2`)
 - rust-lang/rust#149550 (Disable native-lib for x check miri)
 - rust-lang/rust#149554 (build-manifest: generate MSI and MINGW arrays from rustc)
 - rust-lang/rust#149557 (c-variadic: bpf and spirv do not support c-variadic definitions)
 - rust-lang/rust#149569 (Fix mailmap issue)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-04 08:18:30 +00:00
Matthias Krüger
eeff7ad20f
Rollup merge of #149569 - blyxyas:mailmap, r=Mark-Simulacrum
Fix mailmap issue

My name and username got separated in thanks.rust-lang.org, probably due to me changing my email in Github about a month ago.
2025-12-04 08:46:25 +01:00
Matthias Krüger
62a42e8a31
Rollup merge of #149557 - folkertdev:c-variadic-not-supported, r=workingjubilee
c-variadic: bpf and spirv do not support c-variadic definitions

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

Emit a nice error message on bpf and spirv targets when a c-variadic function is defined. Spirv also does not support c-variadic calls, bpf appears to allow them.

r? ```@workingjubilee```
2025-12-04 08:46:24 +01:00
Matthias Krüger
b63ef74e5a
Rollup merge of #149554 - mati865:build-manifest-more-gen, r=Mark-Simulacrum
build-manifest: generate MSI and MINGW arrays from rustc

An alternative to rust-lang/rust#149503

The arrays after generating:
```
❯ bat -n build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/build/build-manifest-e0236666c7c4187b/out/targets.rs | rg MSI -A14
 136 static MSI_INSTALLERS: &[&str] = &[
 137     "aarch64-pc-windows-gnullvm",
 138     "aarch64-pc-windows-msvc",
 139     "i686-pc-windows-gnu",
 140     "i686-pc-windows-msvc",
 141     "x86_64-pc-windows-gnu",
 142     "x86_64-pc-windows-gnullvm",
 143     "x86_64-pc-windows-msvc",
 144 ];
 145 static MINGW: &[&str] = &[
 146     "aarch64-pc-windows-gnullvm",
 147     "i686-pc-windows-gnu",
 148     "x86_64-pc-windows-gnu",
 149     "x86_64-pc-windows-gnullvm",
 150 ];
```

r? ```@Mark-Simulacrum```
2025-12-04 08:46:24 +01:00
Matthias Krüger
5105c4fcae
Rollup merge of #149550 - bjorn3:faster_compile_time_deps, r=RalfJung
Disable native-lib for x check miri

This reduces check times for miri from 2m15s to 20s. And reduces check times for miri with --compile-time-deps from 1m50s to 7s. This makes rust-analyzer start a lot faster after switching branches.

r? ```@RalfJung```
2025-12-04 08:46:23 +01:00
Matthias Krüger
05b2958024
Rollup merge of #149549 - Jamesbarford:chore/regression-test-ttbr0_el2, r=WaffleLapkin
Regression test for system register `ttbr0_el2`

Regression test for recognising the `ttbr0_el2` register.

closes rust-lang/rust#97724
2025-12-04 08:46:22 +01:00
Matthias Krüger
8fe12253f7
Rollup merge of #149539 - quaternic:gather-scatter-bits, r=Mark-Simulacrum
Additional test for uN::{gather,scatter}_bits

Feature gate: #![feature(uint_gather_scatter_bits)]
Tracking issue: https://github.com/rust-lang/rust/issues/149069
Accepted ACP: https://github.com/rust-lang/libs-team/issues/695#issuecomment-3549284861

Adds an additional runtime test for `uN::gather_bits` and `uN::scatter_bits` in coretests. They are each other's inverses in a sense, so a shared test can test both with relative ease.

I plan to follow up with optimized implementations for these functions.
2025-12-04 08:46:22 +01:00
Matthias Krüger
420ef95cd7
Rollup merge of #149528 - fee1-dead-contrib:rangeboundreword, r=jieyouxu
reword error for invalid range patterns

For half-open ranges, specifies that the upper bound cannot be the minimum.

Also specify that this only applies to range patterns and not also expressions.

Fixes rust-lang/rust#149165
2025-12-04 08:46:21 +01:00
Matthias Krüger
40c97a9279
Rollup merge of #149501 - lcnr:no-hard-error-on-norm-failure, r=lqd,oli-obk
CTFE: avoid emitting a hard error on generic normalization failures

Fixes rust-lang/rust#149081.

The fix is quite unsatisfying and should not be necessary, cc rust-lang/rust#149283. That change is significantly more involved. This temporary fix introduces some unnecessary complexity and may hide other type system bugs.

cc ````@rust-lang/types```` I think we should try to fix issue rust-lang/rust#149283 in the near future and then remove this hack again.

I originally intended a more targeted fix. I wanted to skip evaluating constants in MIR opts if their body was polymorphic and the current generic arguments still reference generic parameters. Notes from looking into this:
- we only fetch the MIR in the `eval_to_allocation_raw` query
- figuring out which MIR to use is hard
	- dealing with trivial consts is annoying
	- need to resolve instances for associated consts
	- implementing this by hand is hard
- inlining handles this issue by bailing on literally all normalization failures, even the ones that imply an unsoundness
	- `try_normalize_after_erasing_regions` generally does two things
		- deal with ambiguity after inlining
		- deal with error tainting issues (please don't, we should stop doing that)
- CTFE could be changed to always silently ignore normalization failures if we're in a generic body
	- hides actual bugs <- went with this option

r? types
2025-12-04 08:46:20 +01:00
Matthias Krüger
08a5519924
Rollup merge of #149456 - joboet:async-safe-tid, r=Mark-Simulacrum
std: don't call `current_os_id` from signal handler

`current_os_id` is not always async-signal-safe depending on the platform, hence it may not be called from the SIGSEGV handler. Instead, store the thread ID along with the thread name during setup. With rust-lang/rust#144465 merged, this information is available even before the thread main function.
2025-12-04 08:46:19 +01:00
Matthias Krüger
bea2f89de6
Rollup merge of #149183 - tiif:typing_env_fix, r=BoxyUwU
Use `TypingMode::PostAnalysis` in `try_evaluate_const`

As mentioned in https://github.com/rust-lang/rust/pull/148698#discussion_r2541882341, we should use ``TypingMode::PostAnalysis`` for that path.

````@BoxyUwU```` prefer the match in ``try_evaluate_const`` to be exhaustive, so I also included that in this PR :3
2025-12-04 08:46:19 +01:00
Matthias Krüger
82a17b30d8
Rollup merge of #149147 - chenyukang:yukang-fix-unused_assignments-macro-gen-147648, r=JonathanBrouwer
Fix unused_assignments false positives from macros

Fixes rust-lang/rust#147648
2025-12-04 08:46:18 +01:00
Matthias Krüger
5019bdaefe
Rollup merge of #147841 - jdonszelmann:test-macro-ice, r=wafflelapkin
Fix ICE when applying test macro to crate root

This PR does a couple of things. First of all, I found [an ICE](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=a733a7f3d223e1a9712e44b571f3e5cf) that happens when applying `#![core::prelude::v1::test]` to the crate root. This is caused by the test macro not expanding to an item when `--test` isn't applied. For the crate root, that means it deletes the crate....

The fix now first does target checking, and only if the target is valid discards the item when `--test` isn't applied. The discarding is, I think, important for perf.

The problem with this PR is that it means that `#[test]` applied to structs previously would give no errors unless `--test` is applied! That sounds like a bug to me, but maybe we should crater run it just in case, since technically that's a breaking change. Errors in such items wouldn't be reported previously.

 Also fixed a smol diagnostics bug with `#[bench]`'s error messages refering to `#[test]` accidentally.

r? noratrieb (since I already explained you a bunch, feel free to re-assign)

Fixes https://github.com/rust-lang/rust/issues/114920
2025-12-04 08:46:17 +01:00
bors
556beb9ec7 Auto merge of #149602 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to 633cff2520.

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

r? `@ghost`
2025-12-04 05:03:04 +00:00
bors
5325015e29 Auto merge of #149600 - mati865:restore-msys2, r=Kivooeo,tgross35
Revert #149516 to fix i686-pc-windows-gnu host

Revert rust-lang/rust#149516 because it caused dist to pick up x86_64 `libwinpthreads.dll` dependency, resulting in broken toolchain.

Note, I didn't use the procedure explained at: https://forge.rust-lang.org/compiler/reviews.html#reverts because the revert button isn't there.

This reverts commit 5afd8ff8df, reversing
changes made to 7cb02f9752.
2025-12-04 00:12:49 +00:00
Mateusz Mikuła
fdea885b80 Revert #149516 to fix i686-pc-windows-gnu host
Revert #149516 because it caused dist to pick up x86_64
`libwinpthreads.dll` dependency, resulting in broken toolchain.

This reverts commit 5afd8ff8df, reversing
changes made to 7cb02f9752.
2025-12-03 21:23:37 +01:00
blyxyas
876c1c9d31 Unify my name in the mailmap 2025-12-03 16:20:44 +00:00
Lukas Wirth
0e706a5c79
Merge pull request #21195 from Veykril/push-nnzprznzurwz
fix: More proc-macro-srv proto fixes
2025-12-03 16:15:37 +00:00
Jana Dönszelmann
8f8247812e
address review comments 2025-12-03 17:01:49 +01:00
Jana Dönszelmann
97d4d2154f
fixup name in diagnostics 2025-12-03 16:38:24 +01:00
Jana Dönszelmann
9dd3caeebe
only discard items with #[test] on it when target is valid 2025-12-03 16:38:24 +01:00
Jana Dönszelmann
1864bf6a51
ICE when applying test to crate root 2025-12-03 16:38:22 +01:00
Lukas Wirth
0c605dd416 fix: More proc-macro-srv proto fixes 2025-12-03 16:17:51 +01:00
bors
83e49b75e7 Auto merge of #149591 - matthiaskrgr:rollup-b3zm9ke, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#148918 (Remove an outdated test)
 - rust-lang/rust#149244 (Fix std::mem::drop rustdoc misleading statement)
 - rust-lang/rust#149532 (Rename supertrait item shadowing lints)
 - rust-lang/rust#149541 (Various never type test improvements)
 - rust-lang/rust#149590 (linker: Remove special case for `rust-lld` in `detect_self_contained_mingw`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-03 15:13:56 +00:00
tiif
af66b68f63 refactor: make the match exhaustive 2025-12-03 15:01:30 +00:00
tiif
46d8adeb61 Use TypingEnv::fully_monomorphized for evaluating const without generic param path 2025-12-03 15:01:16 +00:00
bjorn3
b3bf3158ec Disable native-lib for x check miri
This reduces check times for miri from 2m15s to 20s. And reduces check
times for miri with --compile-time-deps from 1m50s to 7s. This makes
rust-analyzer start a lot faster after switching branches.
2025-12-03 14:49:36 +00:00
Matthias Krüger
2cc93b898b
Rollup merge of #149590 - petrochenkov:norlld, r=mati865
linker: Remove special case for `rust-lld` in `detect_self_contained_mingw`

`rust-lld` is supposed to live inside sysroot, so it doesn't change the behavior of the function, only removes a potential micro-optimization.

https://github.com/rust-lang/rust/pull/149178#issuecomment-3570619496
r? `@mati865`
2025-12-03 13:05:16 +01:00
Matthias Krüger
a2aa4f08da
Rollup merge of #149541 - WaffleLapkin:never-test, r=lcnr
Various never type test improvements

I want to make sure that the never type ui tests are actually sensible, and to do so I'm trying to clean them up. This mainly adds comments explaining test purposes and removes outdated stuff.

I imagine best reviewed commit-by-commit, I tried to write useful descriptions and group things into small commits.

cc `@lcnr` (I removed `fallback`/`nofallback` terminology in b5f82d4716d0d978b89034c902f88e2d449da636)
2025-12-03 13:05:15 +01:00
Matthias Krüger
49e31cc494
Rollup merge of #149532 - Amanieu:supertrait-shadowing-lints, r=lqd
Rename supertrait item shadowing lints

This follows the lang team decision [here](https://github.com/rust-lang/rust/pull/148605#issuecomment-3525414326) and renames:
- `supertrait_item_shadowing_definition` to `shadowing_supertrait_items`
- `supertrait_item_shadowing_usage` to `resolving_to_items_shadowing_supertrait_items`

The lint levels are left unchanged as allow-by-default until stabilization.
2025-12-03 13:05:14 +01:00
Matthias Krüger
1d3d73ee5a
Rollup merge of #149244 - spastorino:fix-mem-drop-rustdoc, r=ChrisDenton
Fix std::mem::drop rustdoc misleading statement

This is a bit misleading, we were discussing this with our Rust team and some people could think that the compiler does some special magic for this specific function and that's not true or well the compiler does something special but for every function.
The reality according to my understanding is that this is a normal function that takes ownership of the given value and as with every other function mir building injects Drop Terminators , drop elaboration refines this and then we would insert the corresponding drop glue, then potentially calling Drop::drop.

Not sure if it would be best to remove the sentence as this PR does or explaining something along the lines of the previous text.
2025-12-03 13:05:13 +01:00
Matthias Krüger
f6f7ddddd5
Rollup merge of #148918 - WaffleLapkin:tryfromwhattttt, r=jdonszelmann
Remove an outdated test

This... is a weird test.

It has two impls:
- `impl<T> From<Foo<T>> for Box<T>` (commented out, more on that later), and
- `impl<T> Into<Vec<T>> for Foo<T>`

The idea of that test is to show that the first impl doesn't compile, but the second does, thus `TryFrom` should be using `Into` and not `From` (because `Into` is more general, since the `From` impl doesn't compile).

However:
1. The types are different -- `Box` vs `Vec`, which is significant b/c `Box` is fundamental
2. The commented out impl actually compiles! (which wasn't detected b/c it's commented out :\ )

Here is a table for compilation of the impls:

|        | `Vec`        | `Box`          |
|--------|--------------|----------------|
| `From` | since 1.41.0 | never          |
| `Into` | always       | not since 1.28 |

[godbolt used to test this](https://godbolt.org/z/T38E3jGKa)

Order of events:
1. in `1.28` the `incoherent_fundamental_impls` lint becomes deny by default (this is *not* mentioned in the changelog yay)
2. `1.32` changed absolutely nothing, even though this version is credited in the test
3. the test was added (I'm not exactly sure when) (see https://github.com/rust-lang/rust/pull/56796)
4. in `1.41` coherence was relaxed to allow `From`+`Vec` to compile

To conclude: since `1.41` this test does nothing (and before that it was written in a way which did not detect this change). It looks to me like today (since `1.41`) we *could* bound `TryFrom` impl with `From` (but now it'd be a useless breaking change of course).

Am I missing anything? Is there a useful version of this test that could be written?
2025-12-03 13:05:13 +01:00
bors
568b117627 Auto merge of #149555 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

14 commits in 2a7c4960677971f88458b0f8b461a866836dff59..bd979347d814dfe03bba124165dbce9554d0b4d8
2025-11-25 19:58:07 +0000 to 2025-12-02 16:03:50 +0000
- fix(completion): Put host-tuple before actual tuples (rust-lang/cargo#16327)
- fix(lints): use plural form correctly (rust-lang/cargo#16324)
- fix(completions): include `all` in `cargo tree --target` candidates (rust-lang/cargo#16322)
- fix(lints): show lint error number (rust-lang/cargo#16320)
- chore(deps): update compatible (rust-lang/cargo#16318)
- chore(deps): update crate-ci/typos action to v1.40.0 (rust-lang/cargo#16316)
- Do not lock the artifact-dir for check builds + fix uplifting (rust-lang/cargo#16307)
- Properly validate crate names in `cargo install` (rust-lang/cargo#16314)
- Support --filter-platform=host for cargo metadata rust-lang/cargo#9423 (rust-lang/cargo#16312)
- Update to mdbook 0.5 (rust-lang/cargo#16292)
- refactor(clean): Better divide old / new layout (rust-lang/cargo#16304)
- update: silent failure on non-matching package specs with --breaking (rust-lang/cargo#16276)
- fix(log): break timing-info message to multiple (rust-lang/cargo#16303)
- fix(clean): Clean hosts builds with new layout (rust-lang/cargo#16300)
2025-12-03 12:04:40 +00:00
Chayim Refael Friedman
0b59d4867b
Merge pull request #21198 from A4-Tacks/nested-incomplete-let-semi
Fix nested expr missing semicolon in incomplete-let
2025-12-03 11:16:26 +00:00
Vadim Petrochenkov
388c42e72a linker: Remove special case for rust-lld in detect_self_contained_mingw
`rust-lld` is supposed to live in sysroot, so it doesn't change the behavior of the function, only removes a potential micro-optimization.
2025-12-03 14:10:54 +03:00
A4-Tacks
481910002d
Fix nested expr missing semicolon in incomplete-let
Example
---
```rust
fn main() {
    let x = &$0
}
```

**Before this PR**

```rust
fn main() {
    let x = &loop {
        $0
    }
}
```

**After this PR**

```rust
fn main() {
    let x = &loop {
        $0
    };
}
```
2025-12-03 19:06:03 +08:00
Folkert de Vries
fc017dd176
c-variadic: bpf and spirv do not support c-variadic definitions 2025-12-03 11:33:00 +01:00
Chayim Refael Friedman
4503a7c58f
Merge pull request #21197 from ChayimFriedman2/result-alias-display
minor: Introduce a type alias for `HirDisplay`'s `Result`
2025-12-03 10:22:17 +00:00
Chayim Refael Friedman
f523e953f1 Introduce a type alias for HirDisplay's Result
Simplify the code a bit.
2025-12-03 12:12:54 +02:00
Lukas Wirth
95cee9cccf
Merge pull request #21164 from Wilfred/multiple_discover_requests
fix: Allow multiple discover operations
2025-12-03 08:51:11 +00:00
Lukas Wirth
1e3fbf9183
Merge pull request #21188 from Wilfred/fix_rustdoc_and_add_ci
Fix rustdoc warnings and add CI
2025-12-03 08:51:04 +00:00
quaternic
f49eaecca9 reorganize test contents and adjust generated inputs to reduce iterations 2025-12-03 10:08:29 +02:00
bors
8202d11051 Auto merge of #149581 - matthiaskrgr:rollup-w4dixyc, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#148937 (Remove initialized-bytes tracking from `BorrowedBuf` and `BorrowedCursor`)
 - rust-lang/rust#149553 (added default_uwtables=true to aarch64_unknown_none targets)
 - rust-lang/rust#149578 (rustdoc: Fix broken link to `Itertools::format`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-03 07:56:09 +00:00
Matthias Krüger
7432e9ed6c
Rollup merge of #149578 - lapla-cogito:rustdoc_iterformat, r=notriddle
rustdoc: Fix broken link to `Itertools::format`

close rust-lang/rust#148879
2025-12-03 07:36:14 +01:00
Matthias Krüger
7029f47452
Rollup merge of #149553 - BartMassey-upstream:aarch64-none-default-uwtables, r=wesleywiser
added default_uwtables=true to aarch64_unknown_none targets

This patch adds DWARF unwinding tables by default for `aarch64-unknown-none` and `aarch64-unknown-none-softfloat` targets. By implication, the `core` library for these targets will be built with unwinding tables. These tables are often useful, and are especially needed for backtracing through `core` on embedded targets. The tables can be turned off for user compilation with `-C force-unwind-tables=no` if desired.

(I am the lead maintainer for these targets in the Rust Embedded Working Group, and have discussed this with REWG.)
2025-12-03 07:36:13 +01:00
Matthias Krüger
45b2a711b1
Rollup merge of #148937 - joshtriplett:borrowed-buf-no-init-tracking, r=Amanieu
Remove initialized-bytes tracking from `BorrowedBuf` and `BorrowedCursor`

As discussed extensively in libs-api, the initialized-bytes tracking primarily benefits calls to `read_buf` that end up initializing the buffer and calling `read`, at the expense of calls to `read_buf` that *don't* need to initialize the buffer. Essentially, this optimizes for the past at the expense of the future. If people observe performance issues using `read_buf` (or something that calls it) with a given `Read` impl, they can fix those performance issues by implementing `read_buf` for that `Read`.

Update the documentation to stop talking about initialized-but-unfilled bytes.

Remove all functions that just deal with those bytes and their tracking, and remove usage of those methods.

Remove `BorrowedCursor::advance` as there's no longer a safe case for advancing within initialized-but-unfilled bytes. Rename `BorrowedCursor::advance_unchecked` to `advance`.

Update tests.

r? ``@Amanieu``
2025-12-03 07:36:12 +01:00
lapla
8949b816ee
rustdoc: Fix broken link to Itertools::format 2025-12-03 12:56:30 +09:00
bors
672388edbe Auto merge of #149577 - ehuss:update-reference, r=ehuss
Update reference

Pulls in https://github.com/rust-lang/reference/pull/2080 to fix the tests.

Closes https://github.com/rust-lang/rust/issues/149575
2025-12-03 03:30:16 +00:00
Eric Huss
880a779999 Update reference
Pulls in https://github.com/rust-lang/reference/pull/2080 to fix the tests.
2025-12-02 19:27:15 -08:00