301225 Commits

Author SHA1 Message Date
Laurențiu Nicola
750c1e9c39 Preparing for merge from rust-lang/rust 2025-07-21 09:17:54 +03:00
Shoyu Vanilla (Flint)
4bbe74bb6c
Merge pull request #20256 from A4-Tacks/gen-mut-trait-deref
Add Deref -> DerefMut for generate_mut_trait_impl
2025-07-21 04:31:24 +00:00
Shoyu Vanilla (Flint)
33d62b5fba
Merge pull request #20262 from ChayimFriedman2/goto-ref-raw
fix: Fix search of raw labels and lifetimes
2025-07-21 04:30:42 +00:00
The rustc-josh-sync Cronjob Bot
ad20b064c3 Merge ref '460259d14de0' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 460259d14de0274b97b8801e08cb2fe5f16fdac5
Filtered ref: 599ee17eb87c83f97eb37fd9fe264da65d4c9461

This merge was created using https://github.com/rust-lang/josh-sync.
2025-07-21 04:17:50 +00:00
The rustc-josh-sync Cronjob Bot
897d007f8f Prepare for merging from rust-lang/rust
This updates the rust-version file to 460259d14de0274b97b8801e08cb2fe5f16fdac5.
2025-07-21 04:17:44 +00:00
Jacob Pratt
f0da6e2990
Rollup merge of #144235 - Gelbpunkt:run-make-musl, r=jieyouxu
Fix run-make tests on musl hosts

On musl hosts, we already set `-Ctarget-feature=-crt-static` and `IS_MUSL_HOST=1` in compiletest. However, in order for the run-make tests to compile fine on musl hosts, we need to propagate this flag in our rustc invocations to ensure we can generate cdylibs.
2025-07-20 23:11:24 -04:00
Jacob Pratt
95d9c8dfcb
Rollup merge of #144230 - RalfJung:option-as-slice-comment-fix, r=scottmcm
Option::as_slice: fix comment

The implementation got changed in https://github.com/rust-lang/rust/pull/117525 without updating the comment. Now the comment makes no sense any more since there is no intrinsic that returns a pointer in this function any more.

(It is also very strange to say "in the new version" in a comment -- what is that supposed to tell someone reading the code 2 years later? That wording was introduced even earlier, in https://github.com/rust-lang/rust/pull/109179.)

Cc `@GKFX` `@petrochenkov` `@llogiq` `@scottmcm`
2025-07-20 23:11:23 -04:00
Jacob Pratt
b9701de4b1
Rollup merge of #144229 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2025-07-20 23:11:23 -04:00
Jacob Pratt
830b8237de
Rollup merge of #144216 - Nadrieril:revert-pin-hack, r=compiler-errors
Don't consider unstable fields always-inhabited

This reverts the hack in https://github.com/rust-lang/rust/pull/133889 now that `Pin`'s field is no longer public.

Fixes https://github.com/rust-lang/rust/issues/143468.

r? ```@compiler-errors```
2025-07-20 23:11:22 -04:00
Jacob Pratt
b81b2a7ecf
Rollup merge of #144189 - lqd:test-144168, r=petrochenkov
Add non-regression test for #144168

This is a non-regression test for issue rust-lang/rust#144168, reduced from `zerocopy`, to go with https://github.com/rust-lang/rust/pull/144172 since it had no test yet, and we didn't want to delay it from landing.

Closes rust-lang/rust#144168

I've checked that the test does fail without rust-lang/rust#144172.
2025-07-20 23:11:21 -04:00
Jacob Pratt
7d0c7b2dcf
Rollup merge of #144162 - beepster4096:drop_elaborator_debug_impls, r=compiler-errors
Debug impls for DropElaborators

It's a little weird that these just have a completely empty Debug impl. Now they're `ElaborateDropsCtxt { .. }` and `DropShimElaborator { .. }`.
2025-07-20 23:11:21 -04:00
Jacob Pratt
a275a5fb22
Rollup merge of #144159 - ognevny:opt-dist-build-dir, r=Kobzol
opt-dist: change build_dir field to be an actual build dir

make it configurable so users can set build.build-dir option in bootstrap.toml

r? Kobzol

try-job: dist-x86_64-msvc
try-job: dist-x86_64-linux
2025-07-20 23:11:20 -04:00
Jacob Pratt
9fdfaef403
Rollup merge of #144144 - Gelbpunkt:musl-crate-types-test, r=compiler-errors
tests: Skip supported-crate-types test on musl hosts

This test depends on the target-specific default of crt-static for musl targets. However, running the testsuite on a musl host requires setting `crt-static` to `false`, as it wouldn't otherwise be possible to build rustc. This in turn will enable `-Ctarget-feature=-crt-static` for all tests, mismatching the expected `+crt-static` for the musl target tested in this testcase.

Since this test specifically tests the default value of `crt-static` for the musl target, ignoring it entirely makes more sense than manually setting `-Ctarget-feature=+crt-static` here, but both would be valid approaches.
2025-07-20 23:11:20 -04:00
bors
e05ab47e6c Auto merge of #143833 - scottmcm:final-mcp-838, r=compiler-errors
Ban projecting into SIMD types [MCP838]

Closes https://github.com/rust-lang/compiler-team/issues/838

The actual compiler change here is tiny; there's just a bazillion tests to update.

~~Since I'm sure I've missed some, for now~~
~~r ghost~~

try-job: test-various
try-job: x86_64-gnu-nopt
2025-07-21 02:31:56 +00:00
Jens Reidel
a546a7cb25
Fix run-make tests on musl hosts
On musl hosts, we already set -Ctarget-feature=-crt-static and
IS_MUSL_HOST=1 in compiletest. However, in order for the run-make tests
to compile fine on musl hosts, we need to propagate this flag in our
rustc invocations to ensure we can generate cdylibs.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-21 02:14:01 +02:00
Camille GILLOT
538b0004bc Also bail out if predicates contain errors. 2025-07-20 23:15:24 +00:00
Camille GILLOT
1987471d05 Consider parent predicates in ImpossiblePredicates pass. 2025-07-20 22:45:07 +00:00
bors
460259d14d Auto merge of #143309 - compiler-errors:param-sized-fast-path, r=lcnr
Consider param-env for sizedness fast path

Look up `T: Sized` in param-env if `T` is a param or placeholder (the latter is for use in the new solver).
2025-07-20 21:29:18 +00:00
Ralf Jung
50f36c0d34 clippy: make tests work in stage 1 2025-07-20 22:55:15 +02:00
Ralf Jung
192efbbd20 clippy: make tests work in stage 1 2025-07-20 22:55:15 +02:00
Jakub Beránek
e68f5fe9ed Implement check::RustAnalyzer using the tool_check_step macro 2025-07-20 22:49:46 +02:00
Ralf Jung
d2be1c8d00 Option::as_slice: fix comment 2025-07-20 22:39:10 +02:00
Ralf Jung
7bf2dd6295 update lockfile 2025-07-20 22:27:43 +02:00
Ralf Jung
3f9be406a6 fix handling of base address for TypeId allocations 2025-07-20 22:14:27 +02:00
David Mládek
725523e9b0 tests: cover more exported_private_dependencies cases 2025-07-20 21:11:39 +02:00
Marijn Schouten
f147716e7d flt2dec: use fill instead of loop 2025-07-20 18:45:11 +00:00
Michael Goulet
1e96d7a553 Consider param-env for fast path 2025-07-20 17:45:01 +00:00
Scott McMurray
41ce1ed252 Ban projecting into SIMD types [MCP838] 2025-07-20 10:22:09 -07:00
ognevnydemon
6fd83ea5e5 opt-dist: change build_dir field to be an actual build dir
make it configurable so users can set build.build-dir option in bootstrap.toml
2025-07-20 20:19:11 +03:00
Scott McMurray
f790042c6a Update Miri Tests 2025-07-20 10:15:14 -07:00
Scott McMurray
493fd9a541 Update cranelift tests 2025-07-20 10:15:14 -07:00
Scott McMurray
25a804ab06 ...and wasm tests too 2025-07-20 10:15:14 -07:00
Scott McMurray
08b816ff18 So many test updates x_x 2025-07-20 10:15:14 -07:00
bors
9982d6462b Auto merge of #143861 - rust-lang:cargo_update, r=clubby789
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.
r? dep-bumps

The following is the output from `cargo update`:

```txt

compiler & tools dependencies:
     Locking 15 packages to latest compatible versions
    Updating chrono-tz v0.10.3 -> v0.10.4
    Removing chrono-tz-build v0.4.1
    Updating clap v4.5.40 -> v4.5.41
    Updating clap_builder v4.5.40 -> v4.5.41
    Updating clap_derive v4.5.40 -> v4.5.41
    Updating crc32fast v1.4.2 -> v1.5.0
    Updating derive_setters v0.1.7 -> v0.1.8
    Updating libredox v0.1.4 -> v0.1.6
    Updating measureme v12.0.1 -> v12.0.3
    Removing parse-zoneinfo v0.3.1
      Adding phf v0.12.1
      Adding phf_shared v0.12.1
    Updating rustix v1.0.7 -> v1.0.8
    Updating serde_json v1.0.140 -> v1.0.141
    Updating sysinfo v0.36.0 -> v0.36.1
    Updating wasi-preview1-component-adapter-provider v34.0.1 -> v34.0.2
    Updating winnow v0.7.11 -> v0.7.12
note: pass `--verbose` to see 39 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 3 unchanged dependencies behind latest

rustbook dependencies:
     Locking 13 packages to latest compatible versions
    Updating ammonia v4.1.0 -> v4.1.1
    Updating cc v1.2.29 -> v1.2.30
    Updating clap v4.5.40 -> v4.5.41
    Updating clap_builder v4.5.40 -> v4.5.41
    Updating clap_complete v4.5.54 -> v4.5.55
    Updating clap_derive v4.5.40 -> v4.5.41
    Updating crc32fast v1.4.2 -> v1.5.0
    Updating html5ever v0.31.0 -> v0.35.0
    Updating markup5ever v0.16.2 -> v0.35.0
    Updating match_token v0.1.0 -> v0.35.0
    Updating rustix v1.0.7 -> v1.0.8
    Updating serde_json v1.0.140 -> v1.0.141
    Updating winnow v0.7.11 -> v0.7.12
```
2025-07-20 16:53:07 +00:00
Nadrieril
3567ab19a0 Don't consider unstable fields always-inhabited
This reverts the hack in https://github.com/rust-lang/rust/pull/133889
now that `Pin`'s field is no longer public.
2025-07-20 18:23:18 +02:00
dswij
0b168815a4
fix: ignore pattern_type_mismatch when external macro owns the match (#15306)
Don't trigger the `ignore_type_mismatch` lint when the `match scrutinee`
is generated by a macro.

If the macro generates

```
match &scrutinee {
    _ => {},
    () => {},
}
```

We don't expect it to hit on `()`.

Rust Playground example:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=b23aca42440f006660bd7440d02db196

changelog: [`pattern_type_mismatch`]: fix unwanted hit in external macro
2025-07-20 15:29:46 +00:00
bors
0864097cd3 Auto merge of #144219 - GuillaumeGomez:rollup-ha29sql, r=GuillaumeGomez
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#143282 (Add `uX::strict_sub_signed`)
 - rust-lang/rust#143423 (address clippy formatting nits)
 - rust-lang/rust#143720 (Allow `Rvalue::Repeat` to return true in `rvalue_creates_operand` too)
 - rust-lang/rust#144011 (bootstrap: Don't trigger an unnecessary LLVM build from check builds)
 - rust-lang/rust#144112 (bootstrap: Ignore `rust.debuginfo-level-tests` for codegen tests)
 - rust-lang/rust#144125 (Add new `ignore-backends` and `needs-backends` tests annotations)
 - rust-lang/rust#144143 (Fix `-Ctarget-feature`s getting ignored after `crt-static`)
 - rust-lang/rust#144150 (tests: assembly: cstring-merging: Disable GlobalMerge pass)
 - rust-lang/rust#144190 (Give a message with a span on MIR validation error)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-20 13:52:48 +00:00
Guillaume Gomez
ae3708e4b2
Rollup merge of #144190 - scottmcm:spanned-errors-in-mir-validation, r=RalfJung
Give a message with a span on MIR validation error

It was handy to get a source+line link for rust-lang/rust#143833, even if it's just to the function and not necessarily to the statement.

r? mir
2025-07-20 15:34:08 +02:00
Guillaume Gomez
8e7601e10e
Rollup merge of #144150 - Gelbpunkt:globalmerge, r=Mark-Simulacrum
tests: assembly: cstring-merging: Disable GlobalMerge pass

The test relies on LLVM not merging all the globals into one and would currently otherwise fail on powerpc64le.

See https://github.com/llvm/llvm-project/blob/release/20.x/llvm/lib/CodeGen/GlobalMerge.cpp and here's the assembly generated prior to disabling the pass:

<details>

<summary>Expand me</summary>

```asm
	.abiversion 2
	.file	"cstring_merging.5aa81ea7b99b31fe-cgu.0"
	.section	.text.cstr,"ax",``@progbits``
	.globl	cstr
	.p2align	4
	.type	cstr,``@function``
cstr:
.Lfunc_begin0:
	.cfi_startproc
.Lfunc_gep0:
	addis 2, 12, .TOC.-.Lfunc_gep0@ha
	addi 2, 2, .TOC.-.Lfunc_gep0@l
.Lfunc_lep0:
	.localentry	cstr, .Lfunc_lep0-.Lfunc_gep0
	addis 3, 2, .L_MergedGlobals@toc@ha
	li 4, 4
	addi 3, 3, .L_MergedGlobals@toc@l
	addi 3, 3, 4
	blr
	.long	0
	.quad	0
.Lfunc_end0:
	.size	cstr, .Lfunc_end0-.Lfunc_begin0
	.cfi_endproc

	.section	.text.manual_cstr,"ax",``@progbits``
	.globl	manual_cstr
	.p2align	4
	.type	manual_cstr,``@function``
manual_cstr:
.Lfunc_begin1:
	.cfi_startproc
.Lfunc_gep1:
	addis 2, 12, .TOC.-.Lfunc_gep1@ha
	addi 2, 2, .TOC.-.Lfunc_gep1@l
.Lfunc_lep1:
	.localentry	manual_cstr, .Lfunc_lep1-.Lfunc_gep1
	addis 3, 2, .L_MergedGlobals@toc@ha
	li 4, 4
	addi 3, 3, .L_MergedGlobals@toc@l
	addi 3, 3, 8
	blr
	.long	0
	.quad	0
.Lfunc_end1:
	.size	manual_cstr, .Lfunc_end1-.Lfunc_begin1
	.cfi_endproc

	.type	CSTR,``@object``
	.section	.data.rel.ro.CSTR,"aw",``@progbits``
	.globl	CSTR
	.p2align	3, 0x0
CSTR:
	.quad	.L_MergedGlobals
	.size	CSTR, 8

	.type	.L_MergedGlobals,``@object``
	.section	.rodata..L_MergedGlobals,"a",``@progbits``
.L_MergedGlobals:
	.asciz	"foo"
	.asciz	"bar"
	.asciz	"baz"
	.size	.L_MergedGlobals, 12

.set .Lanon.a643e9a6bba67b7953be2b5f96e0e802.0, .L_MergedGlobals
	.size	.Lanon.a643e9a6bba67b7953be2b5f96e0e802.0, 4
.set .Lanon.a643e9a6bba67b7953be2b5f96e0e802.1, .L_MergedGlobals+4
	.size	.Lanon.a643e9a6bba67b7953be2b5f96e0e802.1, 4
.set .Lanon.a643e9a6bba67b7953be2b5f96e0e802.2, .L_MergedGlobals+8
	.size	.Lanon.a643e9a6bba67b7953be2b5f96e0e802.2, 4
	.ident	"rustc version 1.90.0-dev"
	.section	".note.GNU-stack","",``@progbits``
```

</details>
2025-07-20 15:34:08 +02:00
Guillaume Gomez
1e6ef245cd
Rollup merge of #144143 - Gelbpunkt:target-features-crt-static, r=RalfJung
Fix `-Ctarget-feature`s getting ignored after `crt-static`

The current behaviour introduced by commit a50a3b8e318594c41783294e440d864763e412ef would discard any target features specified after `crt-static` (the only member of `RUSTC_SPECIFIC_FEATURES`). This is because it returned instead of continuing processing the next feature.

I wasn't entirely sure how the regression test should look like, but this one should do. If anyone has some suggestions, I'm happy to learn, it's my first test :)

I've confirmed that the test fails without the fix on `powerpc64le-unknown-linux-musl` and `x86_64-unknown-linux-gnu`.

cc ``@RalfJung``
2025-07-20 15:34:07 +02:00
Guillaume Gomez
2abca9c43f
Rollup merge of #144125 - GuillaumeGomez:new-annotations, r=Kobzol
Add new `ignore-backends` and `needs-backends` tests annotations

Part of https://github.com/rust-lang/compiler-team/issues/891.

Next step will be to add these annotations in the files where either the output is different based on the codegen (like `asm` tests) or that are known to fail in the GCC backend.

cc `@oli-obk` `@antoyo`
r? `@Kobzol`
2025-07-20 15:34:07 +02:00
Guillaume Gomez
cb6542e7e3
Rollup merge of #144112 - Enselic:no-debuginfo-in-codegen, r=Mark-Simulacrum
bootstrap: Ignore `rust.debuginfo-level-tests` for codegen tests

As dicussed in https://github.com/rust-lang/rust/issues/61117#issuecomment-495587364, codegen tests typically depend on the raw LLVM IR output and are sensitive to debuginfo level. So do not apply `rust.debuginfo-level-tests` for codegen tests.

Before this commit:

    $ ./x test --set rust.debuginfo-level-tests=2 tests/codegen --force-rerun
    test result: FAILED. 654 passed; 136 failed; 75 ignored; 0 measured; 0 filtered out; finished in 3.22s

After this commit:

    $ ./x test --set rust.debuginfo-level-tests=2 tests/codegen --force-rerun
    NOTE: ignoring `rust.debuginfo-level-tests=2` for codegen tests
    test result: ok. 790 passed; 0 failed; 75 ignored; 0 measured; 0 filtered out; finished in 3.21s

### Run this in CI?

Maybe it will make sense to add this to CI later but I think it is too early to do now before more non-codegen tests work with `rust.debuginfo-level-tests=2`.
2025-07-20 15:34:06 +02:00
Guillaume Gomez
2a4a4112b3
Rollup merge of #144011 - Zalathar:check-compiler-no-llvm, r=Kobzol
bootstrap: Don't trigger an unnecessary LLVM build from check builds

Coming back to r-l/r development after a few weeks away, I found a major regression in my dev workflows: running `x check compiler` (either manually or via rust-analyzer) would have the side-effect of building LLVM, even though that shouldn't be necessary.

For my main build directory this would be a minor annoyance, but for my separate rust-analyzer build directory it's a huge problem because it causes a completely separate build of LLVM, which takes a long time and should be completely unnecessary.

---

After some investigation, I tracked down the problem to the `can_skip_build` check in this code:

3014e79f9c/src/bootstrap/src/core/build_steps/compile.rs (L1382-L1396)

Historically, this would skip the LLVM build for stage 0 check builds. But after the recent stage 0 std redesign and some associated check stage renumbering (e.g. rust-lang/rust#143048), the condition `builder.top_stage == build_stage` is now false, because `top_stage` is 1 (due to the renumbering) but `build_stage` is 0 (because a “stage 1” non-library check build still uses the stage 0 compiler).

---

Because this is a critical contributor roadblock for me, I have tried to fix this in a relatively narrow way. It's possible that all of this surrounding logic could be greatly simplified (especially in light of the stage redesign changes), but I didn't want this fix to be held back by scope creep.

---

(Zulip thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Bootstrap.20incorrectly.20building.20LLVM.20for.20check.20builds/near/528991035)
2025-07-20 15:34:06 +02:00
Guillaume Gomez
2461d6ccb8
Rollup merge of #143720 - scottmcm:rvalue-always-operand, r=lcnr
Allow `Rvalue::Repeat` to return true in `rvalue_creates_operand` too

The conversation in https://github.com/rust-lang/rust/pull/143502#discussion_r2189410911 made be realize how easy this is to handle, since the only possibilty is ZSTs -- everything else ends up with the destination being `LocalKind::Memory` and thus doesn't call `codegen_rvalue_operand` at all.

This gets us perilously close to a world where `rvalue_creates_operand` only ever returns true.  (See rust-lang/rust#143860 for more.)
2025-07-20 15:34:05 +02:00
Guillaume Gomez
5ba1251b55
Rollup merge of #143423 - hkBst:clippy-fix-1, r=workingjubilee
address clippy formatting nits

- int_log10.rs: change top level doc comments to outer
- collect.rs: remove empty line after doc comment
- clippy fix: markdown indentation for indented items after line break: a markdown list item continued over multiples lines, but those following lines which are part of the same item are not indented
- clippy fix: bound in one place: when there is a bound in angle brackets and another bound on the same variable in a where clause
2025-07-20 15:34:04 +02:00
Guillaume Gomez
0162cc50e3
Rollup merge of #143282 - nxsaken:strict_sub_signed, r=jhpratt
Add `uX::strict_sub_signed`

rust-lang/rust#116090 missed `strict_sub_signed`, adding it here.
Part of rust-lang/rust#118260.

r? ``@m-ou-se``
2025-07-20 15:34:04 +02:00
Camille GILLOT
7da6fd1221 Lower extra lifetimes before normal generic params. 2025-07-20 13:21:22 +00:00
Camille GILLOT
313dff14b9 Add test. 2025-07-20 13:21:22 +00:00
Camille GILLOT
257b024148 Unquerify maybe_unused_trait_imports. 2025-07-20 13:19:05 +00:00
Camille GILLOT
258e410feb Unquerify maybe_unused_trait_imports. 2025-07-20 13:19:05 +00:00