Commit Graph

171838 Commits

Author SHA1 Message Date
sgasho e7c268f883 Link LLVM dynamically on aarch64-apple-darwin 2026-03-22 16:06:31 +09:00
bors 44e662074f Auto merge of #154148 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

14 commits in cbb9bb8bd0fb272b1be0d63a010701ecb3d1d6d3..e84cb639edfea2c42efd563b72a9be0cc5de6523
2026-03-13 14:34:16 +0000 to 2026-03-21 01:27:07 +0000
- Fix symlink_and_directory when running in a long target dir name (rust-lang/cargo#16775)
- cargo clean: Validate that target_dir is not a file  (rust-lang/cargo#16765)
- fix: fetching non-standard git refspecs on non-github repos (rust-lang/cargo#16768)
- Update tar to 0.4.45 (rust-lang/cargo#16771)
- chore: Remove edition_lint_opts from Lint (rust-lang/cargo#16762)
- refactor: split out several smaller changes to prepare for async http (rust-lang/cargo#16763)
- fix(compile): Make build.warnings ignore non-local deps (rust-lang/cargo#16760)
- fix: detect circular publish dependency cycle in workspace publish (rust-lang/cargo#16722)
- refactor(shell): Pull out term integration into `anstyle-progress` (rust-lang/cargo#16757)
- test: reproduce rustfix panic on overlapping suggestions (rust-lang/cargo#16705)
- fix: Avoid panic for package specs with an empty fragment (rust-lang/cargo#16754)
- refactor(registry): avoid dynamic dispatch for Registry trait (rust-lang/cargo#16752)
- refactor(shell): Pull out hyperlink logic into anstyle-hyperlink (rust-lang/cargo#16749)
- refactor(install): Remove dead code (rust-lang/cargo#16718)
2026-03-21 04:11:42 +00:00
Weihang Lo 01ea06bfd3 Update cargo submodule 2026-03-20 23:05:00 -04:00
Jonathan Brouwer c6cfacae68 Rollup merge of #154121 - teor2345:typos-md-03-20, r=jdonszelmann
Fix typos and markdown errors

This PR fixes some typos and markdown errors I found while writing rust-lang/rust#153697.

I've split it out to reduce the size of that PR.
2026-03-20 13:24:26 +01:00
Stuart Cook a194bea98d Rollup merge of #154059 - Enselic:dropped-mutex-guard, r=Kivooeo
tests: Activate `must_not_suspend` test for `MutexGuard` dropped before `await`

After bisect it turns out that the test passes in `nightly-2023-09-24` but fails in `nightly-2023-09-23`:

    $ rustc +nightly-2023-09-23 --edition 2018 tests/ui/lint/must_not_suspend/mutex-guard-dropped-before-await.rs
    error: `MutexGuard` held across a suspend point, but should not be
      --> tests/ui/lint/must_not_suspend/mutex-guard-dropped-before-await.rs:13:9
       |
    13 |     let lock = foo.lock().unwrap();
       |         ^^^^
    ...
    18 |     bar().await;
       |           ----- the value is held across this suspend point
       |

That leaves us with

<details>
<summary>git log e4133ba9b1a150..13e6f24b9adda67 --no-merges --oneline </summary>

bffb3467e1 Make test more robust to opts.
44ac8dcc71 Remove GeneratorWitness and rename GeneratorWitnessMIR.
855a75b6d6 Remove useless wrapper.
baa64b0e77 Remove dead error code.
6aa1268900 Bless clippy.
d989e14cf2 Bless mir-opt
211d2ed07b Bless tests.
286502c9ed Enable drop_tracking_mir by default.
a626caaad9 Revert duplication of tests.
ff03204365 Fold lifetimes before substitution.
9450b75986 Do not construct def_path_str for MustNotSuspend.
58ef3a0ec9 diagnostics: simpler 83556 handling by bailing out
79d685325c Check types live across yields in generators too
c21867f9f6 Check that closure's by-value captures are sized
d3dea30cb4 Point at cause of expectation of `break` value when possible
4ed4913e67 Merge `ExternProviders` into the general `Providers` struct
2ba911c832 Have a single struct for queries and hook
9090ed8119 Fix test on targets with crt-static default
5db9a5ee38 Update cargo
9defc971f1 Add tracing instrumentation, just like queries automatically add it
2157f31731 Add a way to decouple the implementation and the declaration of a TyCtxt method.
d5ec9af09d Add test to guard against VecDeque optimization regression
3799af3337 diagnostics: avoid mismatch between variance index and hir generic
34c248d31f compiletest: load supports-xray from target spec
64e27cb4d9 compiletest: load supported sanitizers from target spec
bc7bb3c8e7 compiletest: use builder pattern to construct Config in tests

</details>

of which 286502c9ed (https://github.com/rust-lang/rust/pull/107421) seems most likely. I can't find an existing test except the "inactive" one, so let's simply activate it.

Closes rust-lang/rust#89562 which is where the activated test comes from. The test was originally added in rust-lang/rust#89826.

Tracking issue:
- rust-lang/rust#83310
2026-03-20 15:33:07 +11:00
Stuart Cook 1f5915e133 Rollup merge of #153992 - ferrocene:jyn/bootstrap-backtrace, r=jieyouxu,kobzol
bootstrap: Optionally print a backtrace if a command fails

I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
2026-03-20 15:33:06 +11:00
Stuart Cook 319df85a09 Rollup merge of #154048 - GuillaumeGomez:missing_doc_code_examples-improvement, r=lolbinarycat
Don't emit rustdoc `missing_doc_code_examples` lint on impl items

@lolbinarycat realized in [this comment](https://github.com/rust-lang/rust/pull/153964#discussion_r2953956702) that we weren't testing some cases for the `missing_doc_code_examples` lint. Turns out that it was not handling this case well. =D

So in short: `missing_doc_code_examples` lint should not be emitted on impl items and this PR fixes that.

r? @lolbinarycat
2026-03-20 15:33:05 +11:00
teor 55d9f7cb6c Fix typos and outdated comments 2026-03-20 11:22:53 +10:00
Jonathan Brouwer 71e463b8d9 Rollup merge of #154041 - ferrocene:jyn/bless-hashes, r=jieyouxu
bootstrap: Allow `--bless`ing changes to editor settings files

Previously, on any change you would have to first edit all 4 settings files by hand, then run the tests 4 times in a row to discover what the new hashes are. After this change, you still need to edit the files by hand, but you can now run `x test --bless -- hash` to update the hashes without manually editing them.
2026-03-19 13:42:43 +01:00
Jonathan Brouwer 1c77331593 Rollup merge of #153681 - cuviper:ci-llvm-22, r=Mark-Simulacrum
ci: add runners for vanilla LLVM 22

Ubuntu 26.04 has `llvm-22` packages that we can test with.
The `Dockerfile` is otherwise the same as the `llvm-21` runners.
2026-03-19 13:42:26 +01:00
Jonathan Brouwer 2c49023125 Rollup merge of #153333 - gautam899:main, r=Mark-Simulacrum
Fix bootstrap rust build failure for vxworks

Fixes rust-lang/rust#153332

Starting with VxWorks 25.09, struct stat was updated to use struct timespec instead of time_t for timestamp fields.

The following changes were made in libc in the commit [libc](https://github.com/rust-lang/libc/pull/4781).

As a result, when performing a bootstrap build with VxWorks ≥ 25.09, libc no longer exposes the fields st_mtime, st_atime, and st_ctime, as they are conditionally compiled in src/vxworks/mod.rs here [libc](https://github.com/rust-lang/libc/blob/56caa81b6b433c49c5704bf0400a02d428cfacda/src/vxworks/mod.rs#L229). This causes the build to fail.

For VxWorks versions earlier than 25.09, the build completes successfully without errors.

This PR resolves the issue by detecting the WIND_RELEASE_ID environment variable (which is set in the VxWorks build environment) and conditionally guarding the affected functions in the two additional files where the errors originate.
2026-03-19 13:42:25 +01:00
Jonathan Brouwer ed012ea19e Rollup merge of #152870 - mati865:mingw-disable-packed-debuginfo-in-bootstrap, r=Mark-Simulacrum
Do not enable split debuginfo for windows-gnu

Because rustc doesn't handle split debuginfo for these targets, enabling that option causes them to be missing some of the debuginfo.
2026-03-19 13:42:23 +01:00
Jynn Nelson 1098a9d032 Support --bless-ing editor hashes 2026-03-19 05:30:33 +01:00
Martin Nordholts 45b22efe06 tests: Activate must_not_suspend test for MutexGuard dropped before await
The test pass in `nightly-2023-09-24` but fail in `nightly-2023-09-23`:

    $ rustc +nightly-2023-09-23 --edition 2018 tests/ui/lint/must_not_suspend/mutex-guard-dropped-before-await.rs
    error: `MutexGuard` held across a suspend point, but should not be
      --> tests/ui/lint/must_not_suspend/mutex-guard-dropped-before-await.rs:13:9
       |
    13 |     let lock = foo.lock().unwrap();
       |         ^^^^
    ...
    18 |     bar().await;
       |           ----- the value is held across this suspend point
       |
2026-03-18 21:36:11 +01:00
Guillaume Gomez 74c51ce75e Don't emit missing_doc_code_examples on impl items 2026-03-18 17:28:17 +01:00
Jynn Nelson a4d2384100 Move hashes into a separate json file 2026-03-18 12:21:32 +01:00
Jynn Nelson c8a2c46eda bootstrap: Optionally print a backtrace if a command fails 2026-03-18 11:12:11 +01:00
Stuart Cook 44c87292ac Rollup merge of #153778 - bjorn3:driver_cleanups, r=TaKO8Ki
Couple of driver interface improvements

* Pass Session to `make_codegen_backend` callback. This simplifies some code in miri.
* Move env/file_depinfo from ParseSess to Session. There is no reason it has to be in ParseSess rather than Session.
* Rename hash_untracked_state to track_state to indicate that it isn't just used for hashing state, but also for adding env vars and files to be tracked through the dep info file.
2026-03-18 15:07:31 +11:00
Jonathan Brouwer 270bca8608 Rollup merge of #153994 - cyrgani:no-invalid-test-dir, r=Kivooeo
move `tests/ui/invalid` tests to new folders

Just some renaming of tests to remove another vague directory.

r? @Kivooeo
2026-03-17 21:20:03 +01:00
Jonathan Brouwer c608c63cc4 Rollup merge of #153965 - Darksonn:kasan-minor-bugs, r=JonathanBrouwer
Fix minor kasan bugs

Fixes a few minor bugs discovered during rust-lang/rust#153049.
2026-03-17 17:51:35 +01:00
Jonathan Brouwer 626f9d39da Rollup merge of #153622 - RalfJung:rm-soft-unstable, r=JonathanBrouwer
remove concept of soft-unstable features

Implements https://github.com/rust-lang/compiler-team/issues/972

@rust-lang/libs-api last chance to speak up before this feature is gone :)

Fixes https://github.com/rust-lang/rust/issues/153572
Fixes https://github.com/rust-lang/rust/issues/64266
2026-03-17 17:51:32 +01:00
Jonathan Brouwer bf0c6d5648 Rollup merge of #153531 - homersimpsons:chore/fix-LegacyKeyValueFormat-various, r=marcoieni
Fix LegacyKeyValueFormat report from docker build: various

Part of https://github.com/rust-lang/rust/pull/152305

r? @marcoieni
2026-03-17 17:51:31 +01:00
Jonathan Brouwer f7c9081d5d Rollup merge of #152968 - khyperia:regionkind-comment, r=BoxyUwU
Flip "region lattice" in RegionKind doc comment

If we assume that references take their region covariantly, and use that to define the subtyping relationship of regions, `'empty` is ⊤ (top) and `'static` is ⊥ (bottom), and that `'a <: 'b` is defined as `'a >= 'b`. However, the RegionKind doc comment's "region lattice" had `'static` at Top. While this is perhaps technically correct (a so-called "region lattice" is not a "type lattice"), it confused me a lot, and took me half an hour to be like "no, ok, I *do* understand things correctly, this region lattice is just flipped from the subtype lattice". Seems better to just have them be the same!

I also took the opportunity to rewrite some parts of the comment with notes that would have helped me when starting out.

Bikesheds welcome (as long as they don't go on forever)!

For context: the comment "`'static` is Top" was [written in 2013](https://github.com/rust-lang/rust/commit/a896440ca1b93cc5dc6edd827ea2ae89602bfa9e#diff-8780054cdf09361c4ac2540c7f544ecfdc52a9e610822aabb8bcd2964affcb1cR430), before there was a [discussion in 2014](https://github.com/rust-lang/rust/issues/15699) that clarified that references take their regions covariantly, and `'a <: 'b` is defined as `'a >= 'b`.

See also Zulip thread: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/RegionKind.20rustc.20doc.20comment
2026-03-17 17:51:31 +01:00
Jonathan Brouwer fe6816491f Rollup merge of #153801 - ywxt:parallel-test, r=petrochenkov
Add the option to run UI tests with the parallel frontend

This PR adds two arguments for tests:

1. `--parallel-frontend-threads`: specify `-Zthread` to compile test case (currently UI tests only)
2. `--iteration-count`: the number of times to run each test

Also, due to the non-deterministic diagnostic orders and cycle errors, this PR adds the directive `//@ ignore-parallel-frontend` to ignore tests with cycle error when the parallel-frontend is enabled (by `--parallel-frontend-threads`) and enables `//@ compare-output-by-lines` by default.

Context: [#t-compiler/parallel-rustc > Add the parallel front-end test suite @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Add.20the.20parallel.20front-end.20test.20suite/near/578781369)

This PR should work with https://github.com/rust-lang/rust/pull/153797 together.
2026-03-17 17:51:29 +01:00
Jonathan Brouwer 19f292aabe Rollup merge of #153972 - folkertdev:stdarch-sync-2026-03-16, r=folkertdev,RalfJung
stdarch subtree update

Subtree update of `stdarch` to https://github.com/rust-lang/stdarch/commit/aa3fc334dcb21b2bf5b5b31a52c19435072d7ced.

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

r? @ghost
2026-03-17 17:51:28 +01:00
Folkert de Vries a72aceea2b correct vpdpbusd asserts in miri
in https://github.com/rust-lang/rust/commit/a24022ad4e98bfc5adc47cc114db57b68c8511d2 we changed the argument types to be more accurate, and now the miri asserts on the simd type/size need to reflect that
2026-03-17 13:14:16 +01:00
cyrgani 72732f2013 move tests/ui/invalid tests to new folders 2026-03-17 10:07:52 +00:00
ywxt 1814df18ef Run ui tests on the parallel frontend 2026-03-17 16:22:11 +08:00
Stuart Cook fec951b823 Rollup merge of #153372 - homersimpsons:chore/fix-LegacyKeyValueFormat-x86_64-gnu, r=marcoieni
Fix LegacyKeyValueFormat report from docker build: x86_64-gnu

Part of rust-lang/rust#152305

r? @marcoieni
2026-03-17 15:53:10 +11:00
Alice Ryhl ccd1640893 Add missing needs-sanitizer-kasan directive name
Using kasan naming instead of kernel-address to match existing use in
src/tools/compiletest/src/directives/needs.rs
2026-03-16 14:26:44 +00:00
bors ec15ca96ff Auto merge of #153943 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to https://github.com/rust-lang/rust-analyzer/commit/90c8906e6443e7cee18cece9c2621a8b1c10794c.

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

r? @ghost
2026-03-16 10:36:21 +00:00
Stuart Cook 3a3454407f Rollup merge of #153923 - jyn514:jyn/run-make-debugging, r=jieyouxu
run_make_support: Print the command and output even if it succeeds

Previously, it was quite hard to get access to this output because it was printed to a buffer in memory and then discarded. This output is already hidden behind libtest's output capturing, we don't need to hide it twice.
2026-03-16 15:01:35 +11:00
bors 1e2183119f Auto merge of #153166 - reddevilmidzy:codegen-tidy, r=lcnr
Tidy: disallow TODO in other in-tree projects

Fixes: https://github.com/rust-lang/rust/issues/152280
MCP: https://github.com/rust-lang/compiler-team/issues/963

TODO

* [x] Add ci check to `cg_clif`: https://github.com/rust-lang/rustc_codegen_cranelift/pull/1632
* [x] Add ci check to `cg_gcc`: https://github.com/rust-lang/rustc_codegen_gcc/pull/861

r? lcnr
2026-03-15 20:38:45 +00:00
bors d27207d3d6 Auto merge of #153919 - matthiaskrgr:rollup-UnSAPBk, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#153870 (docs: remove stale reference to `check_let_chain`)
 - rust-lang/rust#153881 (Provide more context on type errors in const context)
 - rust-lang/rust#153887 (Turn label into structured suggestion for `.as_ref()` and `.as_mut()`)
 - rust-lang/rust#153897 (Use less `#[macro_use]` in the query system)
 - rust-lang/rust#153914 (add test for param-env shadowing)
 - rust-lang/rust#153917 (compiletest: show rustdoc logs when `--no-capture`)
2026-03-15 17:27:21 +00:00
Jynn Nelson 00dae097c4 Print the command and output even if it succeeds
Previously, it was quite hard to get access to this output because it
was printed to a buffer in memory and then discarded. This output is
already hidden behind libtest's output capturing, we don't need to hide
it twice.
2026-03-15 17:56:50 +01:00
Matthias Krüger 06dcfe909f Rollup merge of #153917 - jieyouxu:rustdoc-test-debug, r=clubby789
compiletest: show rustdoc logs when `--no-capture`

This should make rustdoc debug log output actually visible in `./x test tests/rustdoc-json/ --no-capture` invocations.

Reported in [#t-infra/bootstrap > Help with &#96;./x test --no-capture&#96; to get logs.](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Help.20with.20.60.2E.2Fx.20test.20--no-capture.60.20to.20get.20logs.2E/with/579547276).

### Example

<details>
<summary>Output</summary>

```bash
$ RUSTDOC_LOG=rustdoc::formats::cache=trace ./x test ./tests/rustdoc-json/span.rs --force-rerun --no-capture
[...]

running 1 tests
status: exit status: 0
command: cd "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span" && env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc" "-L" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span/auxiliary" "-o" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span" "--deny" "warnings" "/home/joe/repos/rust/tests/rustdoc-json/span.rs" "-A" "internal_features" "--output-format" "json" "-Zunstable-options"
stdout: none
--- stderr -------------------------------
2:rustc DEBUG rustdoc::formats::cache cx.cache.crate_version=None
2:rustc DEBUG rustdoc::formats::cache folding mod (stripped: false) "Some("span")", id DefId(DefId(0:0 ~ span[c5a1]))
2:rustc DEBUG rustdoc::formats::cache folding mod (stripped: false) "Some("bar")", id DefId(DefId(0:3 ~ span[c5a1]::bar))
------------------------------------------

.

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 177 filtered out; finished in 345.34ms

Build completed successfully in 0:00:02
```
</details>
2026-03-15 16:52:46 +01:00
Matthias Krüger 81549a3cc1 Rollup merge of #153881 - estebank:const-e0308, r=Kivooeo
Provide more context on type errors in const context

- On `const` and `static` point at the type (like we do for let bindings)
- On fn calls, point at const parameter in fn definition
- On type, point at const parameter in type definition
- On array type lengths, explain that array length is always `usize`
- On enum variant discriminant, mention `repr`
- On default field value using type parameter, provide more context (Fix rust-lang/rust#147748)
2026-03-15 16:52:44 +01:00
bors f125037ccd Auto merge of #153343 - RalfJung:min-max-fix, r=nikic
use correct LLVM intrinsic for min/max on floats



The Rust `minnum`/`maxnum` intrinsics are documented to return the other argument when one input is an SNaN. However, the LLVM lowering we currently choose for them does not match those semantics: we lower them to `minnum`/`maxnum`, which (since https://github.com/llvm/llvm-project/pull/172012) is documented to non-deterministically return the other argument or NaN when one input is an SNaN.

LLVM does have an intrinsic with the intended semantics: `minimumnum`/`maximumnum`. Let's use that instead. We can set the `nsz` flag since we treat signed zero ordering as non-deterministic.

Also rename the intrinsics to follow the IEEE 2019 naming, since that is mostly (and in particular, as far as NaN are concerned) now what we do. Also, `minimum_number` and `minimum` are less easy to mix up than `minnum` and `minimum`.

r? @nikic 
Cc @tgross35 
Fixes https://github.com/rust-lang/rust/issues/149537
Fixes https://github.com/rust-lang/rust/issues/151286
(The issues are only fixed when using the latest supported LLVM, but I don't think we usually track problems specific to people compiling rustc with old versions of LLVM)
2026-03-15 14:16:40 +00:00
Ralf Jung c7220f423b rename min/maxnum intrinsics to min/maximum_number and fix their LLVM lowering 2026-03-15 14:53:00 +01:00
Jieyou Xu 823517c41c compiletest: show rustdoc logs when --no-capture 2026-03-15 21:12:28 +08:00
Stuart Cook f5844e5630 Rollup merge of #153909 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to https://github.com/rust-lang/miri/commit/932cb99aa54716d2b74969061797041fb2d9ef08.

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

r? @ghost
2026-03-15 21:59:23 +11:00
Michael Howell 77eea39d45 rustdoc: error out on --test with --emit
These options don't behave reasonably when combined right now, and there
are no tests and no docs for how they should.

For the short term, make this a fatal error. If we decide to assign this
some semantics, then we can do that at any time.
2026-03-14 19:06:32 -07:00
Ralf Jung 2230a0aff1 Merge pull request #4902 from folkertdev/fix-f128-fixme
implement sqrt and add fixme for `f128`
2026-03-14 20:51:28 +00:00
Esteban Küber bfca1f1187 fix clippy test 2026-03-14 20:43:57 +00:00
Folkert de Vries 681750bd46 add fixmes for f128
also implement sqrt for f128 (using softfloat) and test sqrt for f16 and f128
2026-03-14 20:32:30 +01:00
Chayim Refael Friedman 491852c770 Infer generic args for trait ref and its assoc type
This was already there before the switch to the new solver, but it was reverted during the switch for some reason.
2026-03-14 20:22:14 +02:00
Lukas Wirth 3fca200a6d Merge pull request #21818 from Veykril/push-ystsymytyxkl
internal: Refactor `MirLowerCtx` to use `&ExpressionStore` instead of `&Body`
2026-03-14 16:23:35 +00:00
Lukas Wirth b2d9051502 internal: Refactor MirLowerCtx to use &ExpressionStore instead of &Body 2026-03-14 17:14:44 +01:00
cyrgani c92bb95f6e merge and cleanup the generate-deriving-span-tests.py tests 2026-03-14 14:31:38 +00:00
Ralf Jung 0abbbb0859 Merge pull request #4900 from WhySoBad/network-socket-sockname
Add `getsockname` shim
2026-03-14 12:49:17 +00:00