835 Commits

Author SHA1 Message Date
Jonathan Brouwer 5c896555de Rollup merge of #155351 - ujjwalvishwakarma2006:reorg-tests-01, r=Kivooeo
Reorganize tests from `tests/ui/issues/`

The following tests are reorganized in this pull request

| old-name | new-sub-dir | new-name |
|-|-|-|
| `auxiliary/issue-2316-a.rs` | `resolve/auxiliary` | `resolve-conflict-local-vs-glob-import-a.rs` |
| `auxiliary/issue-2316-b.rs` | `resolve/auxiliary` | `resolve-conflict-local-vs-glob-import-b.rs` |
| `issue-2316-c.rs` | `resolve/` | `resolve-conflict-local-vs-glob-import.rs` |
| `issue-28839.rs` | `reborrow/` | `reborrow-mutable-reference.rs` |
| `issue-32008.rs` | `overloaded/` | `subtyping-both-lhs-and-rhs-in-add-impl.rs` |
| `issue-45425.rs` | `higher-ranked/` | `binop-lhs-hrtb-subtyping.rs` |

r? Kivooeo
2026-04-18 19:23:16 +02:00
ujjwalVishwakarma2006 8c78c33aba Move test files from issues/ to appropriate subdirectories 2026-04-15 23:46:29 +05:30
Jonathan Brouwer b8e88c7f49 Rollup merge of #155062 - ujjwalvishwakarma2006:reorg-tests, r=Kivooeo
Move tests from `tests/ui/issues/` to appropriate directories

In this PR, I am moving the following test from `tests/ui/issues` directory to the appropriate directories, followed by the addition of issue links at the top and reblessing of the stderr files:

| old-name | new-sub-dir | new-name |
|-|-|-|
| `issue-29516.rs` | `auto-traits/` | `distinct-type-tuple-by-negative-impl.rs` |
| `issue-3874.rs` | `binding/` | `ref-in-let-lhs-in-field.rs` |
| `issue-32782.rs` | `feature-gates/` | `feature-gate-check-nested-macro-invocation.rs` |
| `issue-32782.stderr` | `feature-gates/` | `feature-gate-check-nested-macro-invocation.stderr` |
| `issue-5100.rs` | `pattern/` | `match-errors-derived-error-suppression.rs` |
| `issue-5100.stderr` | `pattern/` | `match-errors-derived-error-suppression.stderr` |
| `issue-21033.rs` | `pattern/` | `match-struct-var-having-boxed-field.rs` |

r? Kivooeo
r? Teapot4195
2026-04-13 20:20:04 +02:00
Jonathan Brouwer 2ab9ebfd98 Rollup merge of #155055 - rishi-techo-14:ui-automation, r=Kivooeo
UI automation

# To move issue-3154 and issue-16774 to functional subdirectories:

I have moved 2 tests from tests/ui/issues to their appropriate directories using "test-manager" tool.
## Changes:

- Moved tests/ui/issues/issue-3154.rs to tests/ui/borrowck/missing-lifetime-in-return.rs

- Moved tests/ui/issues/issue-16774.rs to tests/ui/deref/derefmut-closure-drop-order.rs
These moves where performed using the test-manager automation tool.
2026-04-13 20:20:04 +02:00
ujjwalVishwakarma2006 c9bfc85d1e Move tests to appropriate subdirectories 2026-04-12 20:36:55 +05:30
rishi-techo-14 e4da93435e moved 2 tests to organized locations 2026-04-12 19:32:35 +05:30
danieljofficial c00aa3de46 move deref tests out of tests/ui/issues 2026-04-11 10:23:58 +01:00
Jonathan Brouwer 4ba9940cfc Rollup merge of #154473 - danieljofficial:move-tests-borrowck, r=Kivooeo
move borrow checker tests

Hi, I have moved some tests I think should be in the borrowck category. Please let me know if there are issues.  r? @Kivooeo
Related to rust-lang/rust#133895
2026-04-08 14:22:00 +02:00
Jonathan Brouwer 2875d8ef29 Rollup merge of #154506 - ujjwalvishwakarma2006:migrate-transmute-tests-02, r=Kivooeo
Migrate some tests from `tests/ui/issues` to appropriate directories

The following changes have been made in the pull request:

- `tests/ui/issues/issue-25746-bool-transmute.rs` ➝ `tests/ui/transmute/transmute-bool-u8.rs`
- `tests/ui/issues/issue-32377.{rs,stderr}` ➝ `tests/ui/intrinsics/transmute-phantomdata-generic-unequal-size.{rs,stderr}`

The issue links have also been added at the top of each `.rs` file.

r? Kivooeo
2026-04-07 17:26:28 +02:00
ujjwalVishwakarma2006 efbc155094 Move test files into appropriate directories 2026-04-06 10:39:54 +05:30
Jonathan Brouwer 0b7a11ff96 Rollup merge of #154615 - aryannrd:moving-issues, r=Kivooeo
Moving issues
2026-04-02 22:13:56 +02:00
Jonathan Brouwer d7d8255d50 Rollup merge of #154425 - ujjwalvishwakarma2006:migrate-transmute-tests, r=Kivooeo,Teapot4195
Migrate transmute tests

I have made the following changes in this PR:

- `tests/ui/issues/issue-23477.rs` ➝ `tests/ui/transmute/transmute-slice-to-dst.rs`
- `tests/ui/issues/issue-28625.{rs,stderr}` ➝ `tests/ui/transmute/transmute-associated-type-to-slice.{rs,stderr}`

The reason I changed the trait name from `trait Bar` to `trait MyTrait` and `type Bar` to `type MyType` is that the same name (i.e., `Bar`) for the trait and associated type was making it harder to follow the test. It was confusing for me, at least.

r? Kivooeo
2026-04-02 22:13:53 +02:00
cyrgani d24ebcb47c rename some issues-* tests 2026-03-30 20:40:15 +00:00
Aryan Dubey 16c3d975e0 Moved and renamed issue-38160 to macros/macro-const-stringify.rs 2026-03-29 21:19:32 -04:00
danieljofficial a1fd54e08e move borrowck tests out of tests/ui/issues 2026-03-29 06:42:04 +01:00
Aryan Dubey 09e48be115 Moved and renamed issue-49973.rs to layout/opt-repr-i32-min.rs 2026-03-28 20:58:22 -04:00
Aryan Dubey f1797f8cf4 Moved and renamed issue-34571.rs to enum/enum_u8_variant.rs 2026-03-28 14:28:02 -04:00
Ralf Jung 7881a31ccf Rollup merge of #152880 - JohnTitor:tweak-assoc-item-note, r=fmease
Tweak incorrect assoc item note

Fix rust-lang/rust#142797
r? @fmease
2026-03-28 13:15:48 +01:00
Yuki Okushi 531631c7ad Make messages more generic 2026-03-28 16:18:11 +09:00
ujjwalVishwakarma2006 3250d8d28b Move 3 files (2 .rs and 1 .stderr) from ui/issues to ui/transmute 2026-03-26 19:55:26 +05:30
Jonathan Brouwer c8d729b72a Rollup merge of #154386 - ujjwalvishwakarma2006:migrate-ui-tests, r=Kivooeo
Migrate UI tests

In this pull request, I am migrating the following files and adding a comment at the top, including a link to the issue they were regression tests for:
- `tests/ui/issues/issue-4735.rs` ➝ `tests/ui/drop/drop-noncopyable-raw-pointer.rs`
- `tests/ui/issues/issue-17734.rs` ➝ `tests/ui/codegen/box-str-drop-glue.rs`

r? Kivooeo
2026-03-26 00:23:15 +01:00
ujjwalVishwakarma2006 f7b3e88947 Rename two test files 2026-03-26 01:50:12 +05:30
Jonathan Brouwer 4b9e6557dd Rollup merge of #154233 - kyleecodes:tests/reorg-ui-issues, r=Kivooeo
Move ui/issues tests to relevant subdirectories

Related to https://github.com/rust-lang/rust/issues/133895 and [Reorganisation of tests/ui/issues for GSOC](https://github.com/rust-lang/google-summer-of-code?tab=readme-ov-file#reorganisation-of-testsuiissues)

This is the first PR in a batch of PRs.

Moves `ui/issues/issue-17546.rs‎`  ‎-> `ui/variants/variant-result-noresult-used-as-type.rs`

Approach:
1. Check linked issue and test contents, determine new target directory
2. Move / rename tests to reflect purpose.
3. Add issue link / comments in separate commit.
4. Rebless if necessary and remove obsolete stderr.

r? @Kivooeo
2026-03-25 19:53:00 +01:00
Jonathan Brouwer 8ae423e5e8 Rollup merge of #154230 - aryannrd:issue-50411, r=Kivooeo
Moved and rename issue-50411 to tests/ui/mir/inliner-double-elaborate
2026-03-25 19:52:59 +01:00
Jonathan Brouwer 047dee4665 Rollup merge of #154090 - danieljofficial:move-tests-statics, r=Kivooeo
Move tests in the statics category

I have moved some tests I feel belong in the statics directory. Please review and let me know if this is the correct way. I think on the first two files I moved, i forgot to turn off rust analyzer and it probably formatted the files, will this be an issue?
2026-03-25 19:52:57 +01:00
Aryan Dubey 2a543acbaf Moved and rename issue-50411 to tests/ui/mir/inliner-double-elaborate
* Move issue-50411 to tests/ui/mir/inliner-double-elaborate
* Addded the link for the issue to inliner-double-elaborate.rs
* Fix tidy issues
* Renamed to inliner-double-elaborate.rs
2026-03-25 10:13:13 +00:00
kyleecodes 62ba3c1022 Move ui/issues tests to relevant subdirectories
* tests(ui): migrate issues/issue-17546 to ui/resolve
* tests(ui): add gh issue link
* tests(ui/issues): move tests to variants dir
2026-03-25 00:35:04 +00:00
Jonathan Brouwer 364844d8a0 Rollup merge of #154167 - ujjwalvishwakarma2006:move-lto-tests, r=Kivooeo
ui/lto: move and rename two tests from issues/

Move:
- `tests/ui/issues/issue-44056.rs` -> `tests/ui/lto/lto-avx-target-feature.rs`
    - The first test enables both AVX target features and LTO but does not exercise AVX-specific behavior. The test primarily checks that LTO builds successfully with these flags; place it under `ui/lto` for consistency.
- `tests/ui/issues/issue-51947.rs` -> `tests/ui/lto/lto-weak-merge-functions.rs`
    - The second test exercises weak linkage interacting with LTO (merge-functions), so it should belong in `ui/lto`.

I have also added a commented line at the top of each test file indicating the issue it originated from.
2026-03-23 12:14:59 +01:00
danieljofficial 2e30fefde6 move statics test files out of tests/ui/issues 2026-03-23 10:25:45 +01:00
ujjwalVishwakarma2006 9b7dff982e Move and rename LTO-specific test files from tests/ui/issues/ to tests/ui/lto/ 2026-03-22 00:06:06 +05:30
Aryan Dubey a3409fecfa Move issue-52049 to tests/ui/borrowck 2026-03-20 16:49:33 -04:00
Stuart Cook 3cfde0efba Rollup merge of #154020 - aryannrd:move-issue-23891, r=JohnTitor
Moved tests/ui/issues/issue-23891.rs to tests/ui/macros/
2026-03-18 21:26:33 +11:00
Aryan Dubey a9838dd1ea Moved issue-23981 to tests/ui/macros 2026-03-17 18:16:09 -04:00
Jonathan Brouwer 6f13b5244c Rollup merge of #153795 - arferreira:turbofish-span-improvement, r=Kivooeo,eggyal
Point turbofish inference errors at the uninferred generic arg

Follow-up to rust-lang/rust#153751.

When a method call has a turbofish with an uninferred generic argument, point the diagnostic span at the specific `_` that couldn't be inferred instead of the method name.

Before:
```rust
LL |     S.f::<u32, _>(42);
   |       ^ cannot infer type of the type parameter `B`
```

After:
```rust
LL |     S.f::<u32, _>(42);
   |                ^ cannot infer type of the type parameter `B`
```

Path expressions (`None::<_>`, `foo::<_>()`) are not handled yet, that's a separate code path.

cc @eggyal
2026-03-17 21:20:02 +01:00
Jonathan Brouwer 907464d1b7 Rollup merge of #153682 - estebank:tweak-e0599-note, r=wesleywiser
Tweak E0599 note

When not finding a method for a type, but finding it for a single other impl, special case the output to emit a single message instead of a list.

```
error[E0599]: no associated item named `C` found for struct `Fail<i32, u32>` in the current scope
  --> $DIR/wrong-projection-self-ty-invalid-bivariant-arg2.rs:15:23
   |
LL | struct Fail<T: Proj<Assoc = U>, U>(T);
   | ---------------------------------- associated item `C` not found for this struct
...
LL |     Fail::<i32, u32>::C
   |                       ^ associated item not found in `Fail<i32, u32>`
   |
   = note: the associated item was found for `Fail<i32, i32>`
```
instead of

```
   = note: the associated item was found for
           - `Fail<i32, i32>`
```
2026-03-17 21:20:01 +01:00
Jonathan Brouwer a5e030602d Rollup merge of #153894 - estebank:issue-129792, r=nnethercote
Point at unit structs on foreign crates in type errors when they are the pattern of a binding

Consts and unit structs in patterns can be confusing if they are mistaken for new bindings. We already provide some context for unit structs and consts that come from the current crate, we now also point at those from foreign crates, and we properly skip cases where the pattern has type parameters which can't be confused with a new binding. So not suggest making a new binding when other suggestions are already emitted, as the likelihood of the other suggestions being what the user intended is higher. Make new binding suggestion verbose.

Fix rust-lang/rust#129792.

```
error[E0308]: mismatched types
 --> fi.rs:8:9
  |
1 | struct percentage;
  | ----------------- unit struct defined here
...
8 |     let percentage = 4i32;
  |         ^^^^^^^^^^   ---- this expression has type `i32`
  |         |
  |         expected `i32`, found `percentage`
  |         `percentage` is interpreted as a unit struct, not a new binding
help: introduce a new binding instead
  |
8 -     let percentage = 4i32;
8 +     let other_percentage = 4i32;
  |
```
2026-03-17 17:51:33 +01:00
ywxt 6a0ce16654 Ignore tests for the parallel frontend 2026-03-17 17:39:59 +08:00
Stuart Cook ce55e36b0f Rollup merge of #153928 - cyrgani:test-test-tes, r=Kivooeo
remove several redundant tests

Remove the following tests:
* `binding/match-naked-record.rs`: duplicate of `binding/match-naked-record-expr.rs`
* `issues/issue-5192.rs`: duplicate of `box/unit/unique-object-move.rs`
* `macros/unreachable.rs`: duplicate of `macros/unreachable-macro-panic.rs`
* `issues/issue-4830.rs`: this used to test that a parsing error was emitted for obsolete `~` syntax, this was removed long ago
* `moves/array-copy-move.rs`: this used to test that calling methods on a vec with type error elements did not ICE. It no longer makes sense since it contains no method call and the integers do not cause type errors anymore.
2026-03-16 15:01:37 +11:00
cyrgani 6dcb85d55d remove several redundant tests 2026-03-15 20:39:11 +00:00
Esteban Küber 39631fdac1 Point at unit structs on foreign crates in type errors when they are the pattern of a let binding
Consts and unit structs in patterns can be confusing if they are mistaken for new bindings. We already provide some context for unit structs and consts that come from the current crate, we now also point at those from foreign crates, and we properly skip cases where the pattern has type parameters which can't be confused with a new binding. Make new binding suggestion verbose.
2026-03-15 01:50:36 +00:00
Esteban Küber 87d8f5885b 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`
2026-03-14 20:13:43 +00:00
John Kåre Alsaker fed57899b9 Remove value_from_cycle_error specialization for type_of 2026-03-13 18:52:26 +01:00
arferreira e485708b84 Point turbofish inference errors at the uninferred generic arg 2026-03-13 07:29:05 -04:00
arferreira 6e954d376a Bless issue-23041 test after turbofish suggestion suppression 2026-03-12 06:28:54 -04:00
Esteban Küber ed25d008a0 Tweak E0599 note
When not finding a method for a type, but finding it for a single other impl, special case the output to emit a single message instead of a list.

```
error[E0599]: no associated item named `C` found for struct `Fail<i32, u32>` in the current scope
  --> $DIR/wrong-projection-self-ty-invalid-bivariant-arg2.rs:15:23
   |
LL | struct Fail<T: Proj<Assoc = U>, U>(T);
   | ---------------------------------- associated item `C` not found for this struct
...
LL |     Fail::<i32, u32>::C
   |                       ^ associated item not found in `Fail<i32, u32>`
   |
   = note: the associated item was found for `Fail<i32, i32>`
```
instead of

```
   = note: the associated item was found for
           - `Fail<i32, i32>`
```
2026-03-11 00:43:04 +00:00
Jonathan Brouwer e77eff6bc2 Rollup merge of #152966 - raushan728:reorganize-ui-issues-1, r=Kivooeo
Migrate 11 tests from tests/ui/issues to specific directories

Moved 11 regression tests from `tests/ui/issues` to their relevant subdirectories (`imports`, `pattern`, `lint`, and `typeck`).

* Added standard issue tracking comments at the top of each file.
* Relocated associated `aux-build` files.
* Ran `./x.py test --bless` successfully.
2026-03-03 07:14:13 +01:00
Guillaume Gomez bca1cb4c2f Replace emit_span_lint with emit_span_diag_lint in rustc_lint 2026-02-26 09:32:23 +01:00
Raushan Kumar b88534d770 Migrate 11 issue tests to specific subdirectories 2026-02-22 11:01:08 +00:00
bors 7f99507f57 Auto merge of #149375 - oli-obk:const_typeck, r=fee1-dead
Perform many const checks in typeck

Some smaller diagnostic changes, the biggest ones avoided by https://github.com/rust-lang/rust/pull/148641

We should be able to move various checks in mir const checking to using `span_bug!` instead of reporting an error, just like mir typeck does as a sanity check. I would like to start doing so separately though, as this PR is a big enough (in what effects it causes, pun intended).

r? @fee1-dead
2026-02-19 18:41:36 +00:00
Jonathan Brouwer 9330931a2b Rollup merge of #152596 - estebank:multipart_suggestions, r=petrochenkov
Make all multipart suggestions verbose

The ShowAlways style of suggestions is usually easier to understand than the inline style.
2026-02-19 10:56:37 +01:00