Commit graph

23367 commits

Author SHA1 Message Date
bors
46c86aef65 Auto merge of #152025 - jhpratt:rollup-Kxb6k3Y, r=jhpratt
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#151378 (Codegen tests for Arm Cortex-R82)
 - rust-lang/rust#151936 (Move the `fingerprint_style` special case into `DepKindVTable` creation)
 - rust-lang/rust#152018 (Move bigint helper tracking issues)
 - rust-lang/rust#151958 (Add codegen test for SLP vectorization)
 - rust-lang/rust#151974 (Update documentation for `Result::ok()`)
 - rust-lang/rust#151975 (Work around rustfmt giving up on a large expression)
 - rust-lang/rust#151990 (Fix missing unused_variables lint when using a match guard)
 - rust-lang/rust#151995 (stabilize ptr_as_ref_unchecked)
 - rust-lang/rust#151999 (attribute parsing: pass recovery mode to Parser.)
 - rust-lang/rust#152009 (Port rustc_preserve_ub_checks to attr parser)
 - rust-lang/rust#152022 (rustc-dev-guide subtree update)

Failed merges:

 - rust-lang/rust#151968 (Remove `HasDepContext` by merging it into `QueryContext`)
2026-02-03 04:44:02 +00:00
Jacob Pratt
cbebacda0b
Rollup merge of #151999 - mejrs:ignore_nonmeta_v2, r=JonathanBrouwer
attribute parsing: pass recovery mode to Parser.

Fixes https://github.com/rust-lang/rust/issues/151996
2026-02-02 23:12:08 -05:00
Jacob Pratt
b73b8223d8
Rollup merge of #151990 - eggyal:unused-in-match-with-guard, r=nnethercote
Fix missing unused_variables lint when using a match guard

Within a binding pattern match guard, only real reads of a bound local impact its liveness analysis - not the fake read that is injected.

Fixes rust-lang/rust#151983
r? compiler
2026-02-02 23:12:07 -05:00
Jacob Pratt
e2c5b89d2a
Rollup merge of #151958 - chahar-ritik:add-slp-vectorization-test, r=jieyouxu
Add codegen test for SLP vectorization

close: rust-lang/rust#142519

This PR adds a codegen regression test for rust-lang/rust#142519. A regression in LLVM to fail to auto-vectorize, leading to significant performance loss.

The SLP vectorizer correctly groups the 4-byte operations into <4 x i8> vectors.

The loop state is maintained in SIMD registers (phi <4 x i8>).

The test remains robust across architectures (AArch64 vs x86_64) by allowing flexible store types (i32 or <4 x i8>).
2026-02-02 23:12:05 -05:00
Jacob Pratt
b75cdc98ba
Rollup merge of #152018 - clarfonthey:bigint-tracking-issues, r=scottmcm
Move bigint helper tracking issues

Closes rust-lang/rust#85532.

This splits the remainder of the `bigint_helper_methods` tracking issue into three issues:

* `signed_bigint_helpers`: rust-lang/rust#151989
* `widening_mul`: rust-lang/rust#152016
* `const_unsigned_bigint_helpers`: rust-lang/rust#152015

Note that the existing stable methods were merged under the `unsigned_bigint_helpers` feature as part of rust-lang/rust#144494.
2026-02-02 23:12:05 -05:00
Jacob Pratt
c908ea27fd
Rollup merge of #151378 - ferrocene:add-cortexr82-testing, r=jdonszelmann
Codegen tests for Arm Cortex-R82

This PR adds checks to the `aarch64v8r-unknown-none` target to verify that if the Cortex-R82 CPU is enabled (with `-Ctarget-cpu=cortex-r82`), that the appropriate additional AArch64 features are enabled.

This is important because Cortex-R82 is (currently) the only processor implementing Armv8-R AArch64 and it implements a number of Armv8 features over and above the baseline for the architecture. Many of these features are of interest to safety-critical firmware development (for example `FEAT_RASv1p1`, which adds support for the *RAS Common Fault Injection Model Extension*) and so we anticipate them being enabled when building such firmware.

We are offering these tests upstream in-lieu of a full Cortex-R82 specific target because we understand the Project has a preference for architecture-baseline targets over CPU-specific targets.

~~This PR builds on and requires https://github.com/rust-lang/rust/pull/150863, but we've pulled them out as a separate PR.~~ That PR has been merged.

## Ownership

This PR was developed by Ferrous Systems on behalf of Arm. Arm is the owner of these changes.
2026-02-02 23:12:04 -05:00
ltdk
28feae0c87 Move bigint helper tracking issues 2026-02-02 18:45:26 -05:00
Jonathan Brouwer
a34cb947b9
Rollup merge of #151909 - chenyukang:yukang-fix-151607-disjoint-spans, r=Kivooeo
Skip overlapping spans in argument error suggestions

Fixes rust-lang/rust#151607
2026-02-02 18:52:15 +01:00
Jonathan Brouwer
5e1db4491b
Rollup merge of #151872 - JonathanBrouwer:diag3, r=Kivooeo
Add inline syntax for diagnostic messages

This PR adds the new inline diagnostics syntax needed for rust-lang/rust#151366.
The syntax itself is briefly described in the MCP: https://github.com/rust-lang/compiler-team/issues/959

To test these changes:
* I added quite a few uitests
* I converted the first crate `rustc_attr_parsing` to the new syntax in a separate PR: https://github.com/rust-lang/rust/pull/151944

r? @Kivooeo
2026-02-02 18:52:14 +01:00
Jonathan Brouwer
894d05d323
Rollup merge of #151870 - jdonszelmann:regression-test-alias-relate, r=lcnr
regression test for alias-relate changes in lub

r? @lcnr
2026-02-02 18:52:14 +01:00
Jonathan Brouwer
0a7697c23d
Rollup merge of #151695 - Enselic:proc-macro-priv-v2, r=Zalathar
compiletest: Support `--extern` modifiers with `proc-macro` directive

So that the `src/tools/compiletest/src/directives/auxiliary/tests.rs` test does not have to (ab)use the `aux-crate` directive for this purpose.

This is very edge-casey so I don't think we should document this in rustc-dev-guide. Mentioning it will confuse more than it helps. If someone needs to do this they will look at the code and easily find the functionality.

This is a bit hacky since `--extern priv:pm.rs` is not valid, but we can make our directives work however we want. And I think this is a fine pragmatic approach. Doing it "the right way" would be a lot of work for not much gain. Plus, that work can be done incrementally in small steps in the future if wanted.

r? @Zalathar

---

Follow-up to:

- https://github.com/rust-lang/rust/pull/151353
- https://github.com/rust-lang/rust/pull/151670

### Unblocks:
- https://github.com/rust-lang/rust/pull/151691, because without this fix that test fails (see https://github.com/rust-lang/rust/pull/151691#issuecomment-3800315302)
2026-02-02 18:52:12 +01:00
Jorge Aparicio
bdd19d0db3 clarity that the neon extension is present 2026-02-02 15:13:38 +01:00
mejrs
aef8217943 Pass Recovery down to rustc_parse's Parser 2026-02-02 15:01:34 +01:00
Jana Dönszelmann
629ff9b4aa
Update tests/ui/traits/next-solver/generalize/relate-alias-in-lub.rs
Co-authored-by: lcnr <rust@lcnr.de>
2026-02-02 12:48:42 +01:00
Vadim Petrochenkov
c0393cf8db resolve: Report more early resolution ambiguities for imports
The new ambiguities are reported when the import's visibility is ambiguous and may depend on the resolution/expansion order.
2026-02-02 14:44:13 +03:00
Ritik Chahar
8476e893e7
Update min-llvm-version: 22
Co-authored-by: Nikita Popov <github@npopov.com>
2026-02-02 16:47:09 +05:30
Alan Egerton
5aba6b1635
Fix missing unused_variables lint when using a match guard
Within a binding pattern match guard, only real reads of a bound local
impact its liveness analysis - not the fake read that is injected.
2026-02-02 10:57:54 +00:00
ritik chahar
6176945223 fix: remove space for tidy and only for x86_64 2026-02-02 16:05:08 +05:30
ritik chahar
0830a5a928 fix: add min-llvm-version 2026-02-02 15:44:50 +05:30
ritik chahar
95ac5673ce Fix SLP vectorization test CHECK patterns 2026-02-02 15:38:26 +05:30
ritik chahar
c64f9a0fc4 Add backlink to issue 2026-02-02 07:38:14 +05:30
Stuart Cook
cfdd14d964
Rollup merge of #151963 - mcraeynest:main, r=Kivooeo
Add regression test for negative literal in a range of unsigned type

Simple regression test for rust-lang/rust#136514
2026-02-02 10:28:34 +11:00
Stuart Cook
7fe7cee69c
Rollup merge of #151948 - chenyukang:yukang-fix-149954-tokenstream-ice, r=Kivooeo
Handle unbalanced delimiters gracefully in make_attr_token_stream

Fixes rust-lang/rust#149954
2026-02-02 10:28:34 +11:00
Stuart Cook
d748af936b
Rollup merge of #151947 - mu001999-contrib:fix/151878, r=fmease
Include assoc const projections in CFI trait object

Fixes rust-lang/rust#151878

After https://github.com/rust-lang/rust/pull/150843, projections of trait objects should include assoc consts, but the cfi `trait_object_ty` still include only assoc types. So that we got the ICE `expected 1 projection but got 0`.
2026-02-02 10:28:34 +11:00
Stuart Cook
be3bf8276d
Rollup merge of #151923 - TaKO8Ki:issue-151331-opaque-alias-relate, r=Kivooeo,fmease
Fix ICE when projection error reporting sees opaque alias terms

Fixes rust-lang/rust#151331
2026-02-02 10:28:33 +11:00
Stuart Cook
393ce4ba38
Rollup merge of #151895 - Delta17920:move-ui-tests-batch, r=Kivooeo
Move UI tests batch

moved few tests

r? @Kivooeo
2026-02-02 10:28:33 +11:00
Stuart Cook
2cc38ff3fa
Rollup merge of #151483 - ThanhNguyxn:fix/add-test-issue-138225, r=Kivooeo
Add regression test for issue #138225

Adds a regression test for rust-lang#138225.

The compiler used to ICE with `ReferencesError` when compiling code with:
- An undefined type in a struct field
- An async function returning a static reference to that struct
- Optimizations enabled (`-C opt-level=1` or higher)

The bug has been fixed and now correctly reports `E0425: cannot find type`.

Test file: `tests/ui/async-await/ice-static-in-async-fn-issue-138225.rs`
Closes rust-lang/rust#138225
2026-02-02 10:28:31 +11:00
Stuart Cook
e6e2d39136
Rollup merge of #147400 - hkBst:convert-1, r=Mark-Simulacrum
TryFrom<integer> for bool

I noticed the manual TryFrom implementation in [this video from RustConf 2025](https://youtu.be/cOP219vkax8?list=PL2b0df3jKKiRFEuVNk76ufXagOgEJ9sBZ&t=1917) and thought I'd add it.
2026-02-02 10:28:30 +11:00
Maarten Craeynest
f490f6420b
Add regression test for issue-136514: Negative literal in unsigned range 2026-02-01 22:49:57 +01:00
ritik chahar
1c396d24dd Restrict test to x86_64 per reviewer feedback 2026-02-01 22:14:13 +05:30
ritik chahar
0a60bd653d fix: remove trailing newline for tidy 2026-02-01 22:09:05 +05:30
ritik chahar
2292d53b7b Add codegen test for SLP vectorization 2026-02-01 21:41:43 +05:30
mu001999
990c55801e Include assoc const projections in CFI trait object 2026-02-01 22:45:43 +08:00
yukang
2bab7a02f2 Handle unbalanced delimiters gracefully in make_attr_token_stream 2026-02-01 13:16:32 +00:00
Jonathan Brouwer
ca2be71a18
Add verification for inline fluent messages 2026-02-01 11:12:10 +01:00
Jonathan Brouwer
523d9d9200
Uitests for subdiagnostics 2026-02-01 11:12:04 +01:00
Jonathan Brouwer
378c6fc6fe
Uitests for #[diagnostic] 2026-02-01 11:12:03 +01:00
delta17920
a7dea5504b rename various regression tests 2026-02-01 04:09:25 +00:00
bors
a1db344c08 Auto merge of #151924 - JonathanBrouwer:rollup-Pqp8PIn, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151886 (Skip unused_allocation lint when method takes &Box<Self>)
 - rust-lang/rust#150300 (Constify `fmt::from_fn`)
 - rust-lang/rust#151102 (Feature-gate `mut ref` patterns in struct pattern field shorthand)
 - rust-lang/rust#151866 (Reorganizing `tests/ui/issues` 10 tests [4/N] )
 - rust-lang/rust#151890 (Re-export `hashbrown::hash_table` from `rustc_data_structures`)
2026-01-31 23:56:07 +00:00
Jonathan Brouwer
3a54fe982f
Rollup merge of #151866 - zedddie:move-tests, r=Kivooeo
Reorganizing `tests/ui/issues` 10 tests [4/N]

part of https://github.com/rust-lang/rust/issues/133895

r? Kivooeo
2026-01-31 21:42:47 +01:00
Jonathan Brouwer
70f1120363
Rollup merge of #151102 - zachs18:mut-ref-in-struct-pattern-shorthand-gate, r=JonathanBrouwer
Feature-gate `mut ref` patterns in struct pattern field shorthand

Tracking issue for `mut_ref` (and other parts of Match Ergonomics 2024): https://github.com/rust-lang/rust/issues/123076

https://github.com/rust-lang/rust/pull/123080 introduced `mut ref`[^1] patterns (for by-reference bindings where the binding itself is mutable), feature-gated behind the `mut_ref` feature, except for in struct pattern shorthand, where the feature gating was missing. Thus, `mut ref` patterns in struct pattern shorthand has been unintentionally stable for ~18 months (since 1.79.0 ([compiler explorer](https://rust.godbolt.org/z/4WTrvhboT))).

This PR adds feature-gating for `mut ref` patterns in struct pattern shorthand. Since this is reverting an accidental stabilization, this probably needs a crater run and a T-lang FCP?

Some alternative possibilities:

* Do nothing (let the inconsistency exist until `feature(mut_ref)` is stabilized)
* Document the existing behavior
* Do a FCW instead of fully feature-gating
* Stabilize `feature(mut_ref)`

CC https://github.com/rust-lang/rust/pull/123080#issuecomment-3746793632

CC @Nadrieril

[^1]: everything in this description also applies analogously to `mut ref mut` patterns.
2026-01-31 21:42:46 +01:00
Jonathan Brouwer
1c6f67f659
Rollup merge of #151886 - chenyukang:yukang-fix-151846-unused-allocation-box-ref, r=petrochenkov
Skip unused_allocation lint when method takes &Box<Self>

Fixes rust-lang/rust#151846
2026-01-31 21:42:45 +01:00
bors
905b926967 Auto merge of #151622 - scottmcm:elide-more-transmutes, r=cjgillot
GVN: Elide more intermediate transmutes

We already skipped intermediate steps like `u32` or `i32` that support any (initialized) value.

This extends that to also allow skipping intermediate steps whose values are a superset of either the source or destination type.  Most importantly, that means that `usize` → `NonZeroUsize` → `ptr::Alignment` and `ptr::Alignment` → `NonZeroUsize` → `usize` can skip the middle because `NonZeroUsize` is a superset of `Alignment`.

Then `Alignment::as_usize` is updated to take advantage of that and let us remove some more locals in a few places.

r? cjgillot
2026-01-31 20:42:37 +00:00
Takayuki Maeda
c8ce14018f check if ProjectionTy or ProjectionConst
fmt
2026-02-01 05:30:01 +09:00
Jonathan Brouwer
874c5d2275
Rollup merge of #151889 - chenyukang:yukang-fix-151882-frontmatter-ice, r=Kivooeo
Fix ICE when parsing frontmatter without newline

Fixes rust-lang/rust#151882

we can not add a normal test case for it:
- no newline at the end of file, we can bypass this with change test file name with `ignore-tidy`
- multiple errors in stderr, this conflicts with the previous bypass, seems we can not add multiple error annotations in one line

anyway, I added a `run-make` test for it.
2026-01-31 15:17:05 +01:00
zedddie
086dc0258b
clean up some tests 2026-01-31 14:01:54 +01:00
zedddie
4df307acc1
move some tests 2026-01-31 14:00:12 +01:00
yukang
8c0d93bc54 Skip overlapping spans in argument error suggestions 2026-01-31 11:01:51 +00:00
yukang
dc48704f98 Fix ICE when parsing frontmatter without newline 2026-01-31 08:51:40 +00:00
ThanhNguyxn
565b772fa5 Add regression test for ICE with undefined type in async fn 2026-01-31 15:49:54 +07:00