Commit Graph

320844 Commits

Author SHA1 Message Date
Daniel Scherzer 3add6f19d0 rustfmt.toml: drop ignore of deleted test 2026-03-12 21:37:19 -07:00
bors 4efe3dc40f Auto merge of #153791 - JonathanBrouwer:rollup-BMzX17I, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#153787 (Rename `rustc_middle::lint::diag_lint_level` into `lint_level`)
 - rust-lang/rust#153321 (Add high-priority ICEs to tests/crashes)
2026-03-12 21:55:45 +00:00
Jonathan Brouwer 0593e74ad7 Rollup merge of #153321 - fanninpm:test-crashes-add-high-priority, r=Kivooeo
Add high-priority ICEs to tests/crashes

As of when I opened this PR, these two issues, rust-lang/rust#146965 and rust-lang/rust#150263, have been assigned as P-high.
Per [the dev guide](https://rustc-dev-guide.rust-lang.org/tests/compiletest#crash-tests), I am adding these "untracked" crashes to the test suite, if that's okay with the relevant stakeholders.

(I used to contribute to [glacier](https://github.com/rust-lang/glacier) about 5-6 years ago. Let me know if anything needs to change in these tests.)
2026-03-12 20:30:22 +01:00
Jonathan Brouwer 4c56778448 Rollup merge of #153787 - GuillaumeGomez:rename-lint_level, r=JonathanBrouwer,Urgau
Rename `rustc_middle::lint::diag_lint_level` into `lint_level`

Part of https://github.com/rust-lang/rust/issues/153099.

Renaming back `diag_lint_level` into `lint_level` since the original function was completely replaced and removed.

r? @JonathanBrouwer
2026-03-12 20:30:22 +01:00
bors 3102493c71 Auto merge of #153777 - ferrocene:jh/fix-codegen-llvm-tests-on-aarch64, r=jieyouxu
Include optional `dso_local` marker for functions in `enum-[match,transparent-extract].rs`

This PR adds some more `dso_local` markers to the `enum-match.rs` and `enum-transparent-extract.rs` test annotations. These markers are added by LLVM when targeting `aarch64-unknown-none` even though they are missing in `aarch64-unknown-linux-gnu`. This is causing a CI error when running the codegen suite on the `aarch64-unknown-none` target for Ferrocene.

This is a follow up of https://github.com/rust-lang/rust/pull/139891.
2026-03-12 18:20:45 +00:00
Guillaume Gomez 862729e745 Rename rustc_middle::lint::diag_lint_level into emit_lint_base 2026-03-12 18:37:00 +01:00
bors 801bc19d60 Auto merge of #153783 - JonathanBrouwer:rollup-xAG0lwn, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#153705 (Always generate generics in delegation that match trait in trait impl scenario)
 - rust-lang/rust#153751 (Detect existing turbofish on method calls to suppress useless suggestion)
 - rust-lang/rust#153780 (Remove `MTLock`)
 - rust-lang/rust#151572 (Fix Hexagon ABI calling convention for small aggregates)
 - rust-lang/rust#153725 (Fix that `./x test --no-doc` actually keeps the same behaviour for backwards compatability)
2026-03-12 14:53:41 +00:00
Jonathan Brouwer 808889880f Rollup merge of #153725 - ferrocene:jh/fix-x-test-no-doc, r=Kobzol
Fix that `./x test --no-doc` actually keeps the same behaviour for backwards compatability

In https://github.com/rust-lang/rust/pull/153143 the `./x test --no-doc` flag was renamed to `--all-targets`.  I added a commit that keeps the `--no-doc` flag for backwards compatibility, but unfortunately I forgot to actually keep the behaviour the same, which is fixed by this PR.

r? @Kobzol
2026-03-12 15:52:12 +01:00
Jonathan Brouwer 1af198e67c Rollup merge of #151572 - androm3da:bcain/abi_cconv, r=wesleywiser
Fix Hexagon ABI calling convention for small aggregates

Small structs (<= 64 bits) were being passed with their fields split into separate arguments instead of being packed into register-sized chunks. This caused ABI mismatches.

The fix properly casts small aggregates to consecutive register-sized chunks using Uniform::consecutive(), matching the Hexagon C ABI where small structs are packed into R1:0 register pair.

This fixes tests like extern-pass-TwoU16s.rs and extern-pass-TwoU8s.rs.
2026-03-12 15:52:11 +01:00
Jonathan Brouwer 638553526f Rollup merge of #153780 - Zoxc:rm-mtlock, r=bjorn3
Remove `MTLock`

This removes the `MTLock` type and replaces it users with the regular `Lock`. It no longer makes sense now that we don't have a compile-time toggle for parallelism.
2026-03-12 15:52:11 +01:00
Jonathan Brouwer e52df2950c Rollup merge of #153751 - arferreira:fix-useless-e0284-suggestion, r=lcnr
Detect existing turbofish on method calls to suppress useless suggestion

`expr_inferred_arg_iter` hardcoded `have_turbofish: false` for `MethodCall` expressions, while the `Path` case properly checked for existing type arguments via `segment.args`. This meant the "consider specifying the generic arguments" suggestion always fired on method calls, even when the user already had a turbofish, producing a suggestion that just rewrote user syntax into fully qualified form without resolving anything.

Fixes rust-lang/rust#153732.

cc @eggyal
2026-03-12 15:52:10 +01:00
Jonathan Brouwer 3d486d2ffc Rollup merge of #153705 - aerooneqq:delegation-impl-trait-generics, r=petrochenkov
Always generate generics in delegation that match trait in trait impl scenario

After rust-lang/rust#151864 there is a change in delegation code generation in `trait impl` cases: after rust-lang/rust#151864 we started to look at user-specified args and generate functions, whose generics may not match the signature of the function that is defined in trait. Such handling of delegation from trait impl is not correct, as the generated function should always have the same generics as its signature function in trait.

This addresses the "Fix generic params generation in trait impl case" future work from rust-lang/rust#151864

r? @petrochenkov
2026-03-12 15:52:10 +01:00
aerooneqq d87d7b94f8 Always generate generics that match trait in trait impl scenario 2026-03-12 17:25:05 +03:00
John Kåre Alsaker bee28ef7b2 Remove MTLock 2026-03-12 14:37:51 +01:00
Urhengulas 01e3d8549c Include optional dso_local marker for functions in enum-[match,transparent-extract].rs 2026-03-12 14:23:26 +01:00
bors d097a0cba9 Auto merge of #153770 - JonathanBrouwer:rollup-522Yrag, r=JonathanBrouwer
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#153726 (Add optional CI job to build the compiler with the parallel frontend)
 - rust-lang/rust#153763 (Don't add empty target features for target-cpu=native on macOS)
 - rust-lang/rust#153432 (Fix some comments about dataflow analysis.)
 - rust-lang/rust#153529 (Fix LegacyKeyValueFormat report from docker build: pr)
 - rust-lang/rust#153694 (fix(query): Pass Query Key to `value_from_cycle_error`)
 - rust-lang/rust#153717 (unused_macro_rules switched used and unused comments)
 - rust-lang/rust#153736 (add test that an incomplete feature emits a warning)
 - rust-lang/rust#153748 (editorconfig: css uses tabs)
 - rust-lang/rust#153750 (rustc-dev-guide subtree update)
 - rust-lang/rust#153762 (actually make the is-fn test test what it says it tests)
2026-03-12 11:32:41 +00:00
Jonathan Brouwer cf8e79fa9a Rollup merge of #153762 - jdonszelmann:is-fn-test, r=lcnr
actually make the is-fn test test what it says it tests

r? @lcnr

Previously this test was (apart from the comment) identical to tests/ui/async-await/async-closures/once.rs
2026-03-12 12:31:44 +01:00
Jonathan Brouwer 20ef8d1b13 Rollup merge of #153750 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to https://github.com/rust-lang/rustc-dev-guide/commit/f6cc6f634e282fa4cfe25310ed80a14bbc88ee48.

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

r? @ghost
2026-03-12 12:31:43 +01:00
Jonathan Brouwer 32143e9676 Rollup merge of #153748 - lolbinarycat:editorconfig-css, r=jieyouxu
editorconfig: css uses tabs

Tidy enforces the fact that css files use tabs, but currently `.editorconfig` says everything that isn't llvm or a Makefile should always use spaces.  This PR makes it so all editors that honor `.editorconfig` will use the correct indentation for css files.
2026-03-12 12:31:43 +01:00
Jonathan Brouwer 82017d9f5c Rollup merge of #153736 - cyrgani:incomplete-2, r=fmease
add test that an incomplete feature emits a warning

Related to https://github.com/rust-lang/compiler-team/issues/974, this PR adds a new test to specifically check that a dummy incomplete feature triggers the `incomplete_features` lint. (since this seemed to be the favored approach on Zulip)

Alternative to https://github.com/rust-lang/rust/pull/153706.

r? fmease
2026-03-12 12:31:42 +01:00
Jonathan Brouwer 9488c30b6c Rollup merge of #153717 - ralpha:unused_macro_rules-lint-correction, r=TaKO8Ki
unused_macro_rules switched used and unused comments

Incorrect swapping of "used" and "unused".

The lint example:
```rust
#[warn(unused_macro_rules)]
macro_rules! unused_empty {
    (hello) => { println!("Hello, world!") }; // This rule is unused
    () => { println!("empty") }; // This rule is used
}

fn main() {
    unused_empty!(hello);
}
```

It is clearly using the `(hello)` case. Yet it is labeled as "unused".
This PR fixed that small issue and corrects the mistake.
2026-03-12 12:31:42 +01:00
Jonathan Brouwer 04cf7532ea Rollup merge of #153694 - TKanX:bugfix/153391-cycle-error-key-param, r=nnethercote
fix(query): Pass Query Key to `value_from_cycle_error`

### Summary:

Pass the query key directly to `value_from_cycle_error` so that `FromCycleError` impls (notably `FnSig`) can use the recovered query's `DefId` instead of relying on `cycle[0]`, which is arbitrarily rotated by the parallel deadlock handler.

As suggested in [#153644 (comment)](https://github.com/rust-lang/rust/pull/153644#issuecomment-4030645331).

Closes rust-lang/rust#153391

r? @nnethercote
cc @zetanumbers
2026-03-12 12:31:41 +01:00
Jonathan Brouwer 8aea29b091 Rollup merge of #153529 - homersimpsons:chore/fix-LegacyKeyValueFormat-pr, r=marcoieni
Fix LegacyKeyValueFormat report from docker build: pr

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

r? @marcoieni
2026-03-12 12:31:40 +01:00
Jonathan Brouwer 5d17f08215 Rollup merge of #153432 - nnethercote:dataflow-comments, r=cjgillot
Fix some comments about dataflow analysis.

Mostly in the examples in `initialized.rs`. In particular, the `EverInitializedPlaces` example currently doesn't cover how it's initialization sites that are tracked, rather than local variables (that's the `b_0`/`b_1` distinction in the example.)

r? @cjgillot
2026-03-12 12:31:40 +01:00
Jonathan Brouwer 0102e918fd Rollup merge of #153763 - nikic:target-cpu-native-fix, r=lqd
Don't add empty target features for target-cpu=native on macOS

LLVM does not support host feature detection (only host cpu detection) on apple platforms. As such, the returned feature string will be empty. Adding this empty string to the target-features attribute results in a verifier error on LLVM 22.

Fix this by not adding the empty string to the target features. The reason why this was not caught by the target-cpu-native test is that it requires a function that adds *some* target features, otherwise the attribute is omitted entirely. We achieve this with a somewhat peculiar construction that enables `neon` if it's already enabled. (This is to avoid enabling it on softfloat targets.)

Fixes https://github.com/rust-lang/rust/issues/153397.
2026-03-12 12:31:40 +01:00
Jonathan Brouwer 305778ca68 Rollup merge of #153726 - Kobzol:parallel-frontend-tests-optional, r=jieyouxu
Add optional CI job to build the compiler with the parallel frontend

Discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Add.20the.20parallel.20front-end.20test.20suite/with/578684794).

Note: this only builds the compiler, stdlib, etc. with 2 threads. UI tests are still compiled serially. I'd add that in a follow-up PR if we see that this new job works well (and if optional auto jobs work well in the first place).

r? @jieyouxu
2026-03-12 12:31:39 +01:00
arferreira 6e954d376a Bless issue-23041 test after turbofish suggestion suppression 2026-03-12 06:28:54 -04:00
Urhengulas 675290a40d Fix that ./x test --no-doc actually keeps the same behaviour for backwards compatability 2026-03-12 11:06:12 +01:00
Nikita Popov 0670491950 Don't add empty target features for target-cpu=native on macOS
LLVM does not support host feature detection (only host cpu
detection) on apple platforms. As such, the returned feature
string will be empty. Adding this empty string to the target-features
attribute results in a verifier error on LLVM 22.

Fix this by not adding the empty string to the target features.
The reason why this was not caught by the target-cpu-native test
is that it requires a function that adds *some* target features,
otherwise the attribute is omitted entirely. We achieve this with
a somewhat peculiar construction that enables `neon` if it's
already enabled. (This is to avoid enabling it on softfloat targets.)
2026-03-12 10:00:21 +01:00
Jana Dönszelmann 687d7dbc23 actually make the is-fn test test what it says it tests 2026-03-12 09:37:01 +01:00
Jakub Beránek b3333b3aaf Document optional auto jobs in the rustc-dev-guide 2026-03-12 09:35:56 +01:00
Jakub Beránek 96e4833bea Add new CI job that runs tests with a toolchain built with multiple threads 2026-03-12 09:08:51 +01:00
Jakub Beránek ac062fd223 Allow auto jobs to be non-blocking 2026-03-12 09:05:44 +01:00
arferreira 4d47b07353 Detect existing turbofish on method calls to suppress useless suggestion 2026-03-11 22:39:51 -04:00
Tony Kan 3464048bc4 test(parallel): Add regression test for #153391
Co-authored-by: Daria Sukhonina <zetanumbers@users.noreply.github.com>
2026-03-11 19:19:31 -07:00
Tony Kan cfcbcb715c fix(query): Pass query key to value_from_cycle_error
Co-authored-by: Daria Sukhonina <zetanumbers@users.noreply.github.com>
Co-authored-by: Nicholas Nethercote <nnethercote@users.noreply.github.com>
2026-03-11 19:19:24 -07:00
Tshepang Mbambo da4f9a7e65 Merge pull request #2795 from rust-lang/tshepang/sembr
sembr a few files
2026-03-12 02:14:38 +01:00
Tshepang Mbambo 751562faf5 sembr src/tracing.md 2026-03-12 02:10:03 +01:00
Tshepang Mbambo 7963b55d9a sembr src/git.md 2026-03-12 02:09:02 +01:00
Tshepang Mbambo 5de87cd04a sembr src/diagnostics/translation.md 2026-03-12 02:08:20 +01:00
Tshepang Mbambo 5e305ab74d sembr src/backend/updating-llvm.md 2026-03-12 02:05:08 +01:00
binarycat db26b5b8e0 editorconfig: css uses tabs 2026-03-11 18:07:27 -05:00
bors d1ee5e59a9 Auto merge of #153741 - JonathanBrouwer:rollup-xwr7mEB, r=JonathanBrouwer
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#152569 (Stop using rustc_layout_scalar_valid_range_* in rustc)
 - rust-lang/rust#153421 (Fix ICE in fn_delegation when child segment resolves to a trait)
 - rust-lang/rust#153571 (Avoid ICE when an EII declaration conflicts with a constructor)
 - rust-lang/rust#153581 (Simplify `type_of_opaque`.)
 - rust-lang/rust#153611 (interpret: go back to regular string interpolation for error messages)
 - rust-lang/rust#153635 (Unify same-span labels in move error diagnostics)
 - rust-lang/rust#153660 (mir-opt: Drop invalid debuginfos after SingleUseConsts.)
 - rust-lang/rust#153685 (Introduce `for_each_query_vtable!` to move more code out of query macros)
 - rust-lang/rust#153722 (miri-test-libstd: use --tests and update some comments)
 - rust-lang/rust#153671 (Make Enzyme has dependent on LLVM hash)
 - rust-lang/rust#153710 (remove `.ftl` checks from tidy)
 - rust-lang/rust#153720 (doc/rustc: clarify how to contact arm-maintainers)
2026-03-11 21:06:42 +00:00
Jonathan Brouwer f3dfb442a7 Rollup merge of #153720 - davidtwco:contact-arm-maintainers, r=RalfJung
doc/rustc: clarify how to contact arm-maintainers

Addresses feedback from https://github.com/rust-lang/rust/pull/147268#discussion_r2838223188
2026-03-11 22:05:48 +01:00
Jonathan Brouwer 69d352f10c Rollup merge of #153710 - cyrgani:tidy-ftl, r=bjorn3
remove `.ftl` checks from tidy

These files have been removed following https://github.com/rust-lang/compiler-team/issues/959.
Part of https://github.com/rust-lang/rust/issues/151366.
2026-03-11 22:05:48 +01:00
Jonathan Brouwer 23b1e6a8c4 Rollup merge of #153671 - ZuseZ4:make-enzyme-bootstrap-robust, r=Kobzol
Make Enzyme has dependent on LLVM hash

This issue was encountered a few times by autodiff contributors.
Closes https://github.com/rust-lang/rust/issues/152969

Just adding the llvm hash here triggered a rebuild of Enzyme locally, but I'll admit I didn't try it with a real llvm submodule update.

r? @Kobzol
2026-03-11 22:05:47 +01:00
Jonathan Brouwer ad0e037d39 Rollup merge of #153722 - RalfJung:miri-test-benches, r=Kobzol
miri-test-libstd: use --tests and update some comments

rust-lang/rust#153143 added `./x test --tests` matching `cargo --tests`, which is exactly what Miri wants when testing the standard library. So let's use it for that. We can then also remove a hack in `library/alloctests/benches/vec_deque_append.rs`.

Also update the comment for why the other benchmarks still need to be disabled in Miri, and remove some `cfg_attr` that seem unnecessary since the entire crate that contains them is already disabled in Miri. Those were copied over in https://github.com/rust-lang/rust/commit/b8fa843a1a60146b93ca5b1d11bbe23c1b1076f3 -- they used to be needed since benches and tests were in the same crate, but they aren't any more.
2026-03-11 22:05:46 +01:00
Jonathan Brouwer 844950343e Rollup merge of #153685 - Zalathar:for-each-query, r=nnethercote
Introduce `for_each_query_vtable!` to move more code out of query macros

After https://github.com/rust-lang/rust/pull/153114 moved a few for-each-query functions into the big `rustc_query_impl::plumbing` macro, I have found that those functions became much harder to navigate and modify, because they no longer have access to ordinary IDE features in rust-analyzer. Even *finding* the functions is considerably harder, because a plain go-to-definition no longer works smoothly.

This PR therefore tries to move as much of that code back out of the macro as possible, with the aid of a smaller `for_each_query_vtable!` helper macro. A typical use of that macro looks like this:

```rust
for_each_query_vtable!(ALL, tcx, |query| {
    query_key_hash_verify(query, tcx);
});
```

The result is an outer function consisting almost entirely of plain Rust code, with all of the usual IDE affordances expected of normal Rust code. Because it uses plain Rust syntax, it can also be formatted automatically by rustfmt.

Adding another layer of macro-defined macros is not something I propose lightly, but in this case I think the improvement is well worth it:
- The outer functions can once again be defined as “normal” Rust functions, right next to their corresponding inner functions, making navigation and modification much easier.
- The closure expression is ordinary Rust code that simply gets repeated ~300 times in the expansion, once for each query, in order to account for the variety of key/value/cache types used by different queries. Even within the closure expression, IDE features still *mostly* work, which is an improvement over the status quo.
- For future maintainers looking at the call site, the macro's effect should hopefully be pretty obvious and intuitive, reducing the need to even look at the helper macro. And the helper macro itself is largely straightforward, with its biggest complication being that it necessarily uses the `$name` metavar from the outer macro.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
2026-03-11 22:05:46 +01:00
Jonathan Brouwer a00aa4c5fb Rollup merge of #153660 - dianqk:dbg-single-use-const, r=mati865
mir-opt: Drop invalid debuginfos after SingleUseConsts.

Fixes https://github.com/rust-lang/rust/issues/153601.
2026-03-11 22:05:45 +01:00
Jonathan Brouwer ce0374c6ae Rollup merge of #153635 - arferreira:unify-move-error-span-labels, r=estebank
Unify same-span labels in move error diagnostics

Fixes rust-lang/rust#153506.

When there's a single binding in a move error, we emit "data moved here" and "move occurs because ... does not implement the Copy trait" as two separate labels on the same span. This combines them into one label via a new `TypeNoCopy::LabelMovedHere` variant.

The multi-binding case still uses separate labels + a note since they point at different spans.

cc @estebank
2026-03-11 22:05:45 +01:00