Commit Graph

137 Commits

Author SHA1 Message Date
cyrgani
0115f0ea20 fully deprecate the legacy integral modules 2026-07-30 11:33:13 +00:00
Folkert de Vries
afb2e9cb0e use minicore::simd::Simd more 2026-07-23 12:22:51 +02:00
Jonathan Brouwer
c5e1ca83ef Rollup merge of #158992 - estebank:shorten-type-highlighted-lt, r=mejrs
Shorten types more when only interesting part is lifetimes

We have a mechanims (`Highlight`) to change the name of inferred lifetimes in types so that we can refer to them by a number. Modify it so that it also avoids printing sub-parts of the type that are irrelevant to the situation at hand. The new behavior will print any sub part that has *any* lifetime (as they might be informative) instead of *just* the lifetimes being replaced. This was found to produce the best effect empirically in the test suite, striking a nice balance between shortening labels and being informative.

```
error: lifetime may not live long enough
  --> $DIR/wrong-closure-arg-suggestion-125325.rs:46:18
   |
LL |         take(|_| to_fn(|_| self.counter += 1));
   |              --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2`
   |              | |
   |              | return type of closure `aux::Map<{closure@...}>` contains a lifetime `'2`
   |              lifetime `'1` represents this closure's body
   |
   = note: closure implements `Fn`, so references to captured variables can't escape the closure
```
```
error: implementation of `FnOnce` is not general enough
  --> $DIR/higher-ranked-auto-trait-15.rs:20:5
   |
LL |     require_send(future);
   |     ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'0 _) -> Iter<'_, i32>` must implement `FnOnce<(&'1 Vec<i32>,)>`, for any two lifetimes `'0` and `'1`...
   = note: ...but it actually implements `FnOnce<(&Vec<i32>,)>`
```

Made this change after noticing that the first of the errors above had a corresponding `.stderr` file with lines longer than 150 columns by using `rg ".. \| .{150}" -g *.stderr`.
2026-07-16 21:01:53 +02:00
bors
ab4bbeb07d Auto merge of #159354 - zedddie:gsoc-batch-25-meow, r=Kivooeo
Reorganize `tests/ui/issues` [25/N]

Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues)

r? Kivooeo
@Teapot4195
2026-07-16 05:26:38 +00:00
zedddie
e5a03bc9c0 bless batch 2026-07-15 23:38:07 +02:00
zedddie
62fbd98dd9 move batch 2026-07-15 23:38:07 +02:00
Esteban Küber
c6f56924a3 Tweak shortened closure logic 2026-07-15 16:37:18 +00:00
Jacob Pratt
66be5f8e77 Rollup merge of #159308 - zedddie:gsoc-batch-24-meow, r=Teapot4195
Reorganize `tests/ui/issues` [24/N]

Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues)

r? Kivooeo
@Teapot4195
2026-07-15 06:12:13 -04:00
zedddie
0b38c4508c bless batch 2026-07-14 23:21:50 +02:00
zedddie
827474f3b7 move batch 2026-07-14 21:47:59 +02:00
Jonathan Brouwer
03ea3045a4 Rollup merge of #159255 - estebank:shortened-ty-placeholder, r=Kivooeo
Replace shortened type with `_` instead of `...` as placeholder

r? @mejrs
2026-07-14 16:49:09 +02:00
Esteban Küber
5f35fc8b8f Replace shortened type with _ instead of ... as placeholder 2026-07-13 22:48:25 +00:00
Jana Dönszelmann
25745ee1f1 fix all tidy annotations 2026-07-13 10:54:53 +02:00
Jacob Pratt
8c29dd97a6 Rollup merge of #158979 - zedddie:gsoc-batch-21-meow, r=Kivooeo
Reorganize `tests/ui/issues` [21/N]

Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues)

r? Kivooeo
@Teapot4195
2026-07-10 21:53:59 -04:00
Jubilee Young
7fd7514b10 Add regression test for enum miscompilation 2026-07-09 18:39:30 -07:00
zedddie
3c9b183b76 bless batch 2026-07-08 23:47:21 +02:00
zedddie
eee2b6db50 move batch 2026-07-08 23:26:34 +02:00
zedddie
0c42d9225a bless batch 2026-07-03 23:53:11 +02:00
zedddie
9016189942 move batch 2026-07-03 23:37:02 +02:00
Jubilee Young
7bfdb60f23 Comment on needed RAM in huge-stacks.rs 2026-06-29 12:38:04 -07:00
zedddie
c862ccda0b bless batch 2026-06-23 00:51:39 +02:00
zedddie
699346d04f move batch 2026-06-22 23:57:57 +02:00
Takayuki Maeda
fa56cfe69b add UI test for invalid LLVM target in custom target 2026-06-05 18:09:46 +09:00
Jonathan Brouwer
ea21bcc942 Rollup merge of #156317 - lokirithm:reorg-tests-04, r=Kivooeo
Reorg tests 04

| old-name | new-sub-dir | new-name |
|-|-|-|
| `issue-27997.rs` [issue](https://github.com/rust-lang/rust/issues/27997) | `codegen/` | `correctly-monomorphize-generic-drop-impl.rs` |
| `issue-31299.rs` [issue](https://github.com/rust-lang/rust/issues/31299) | `associated-types/` | `sized-recursive-type-via-associated-type.rs` |
| `issue-35815.rs` [issue](https://github.com/rust-lang/rust/issues/35815) | `codegen/` | `dont-roundup-dst-prefix-size-to-alignment.rs` |
| `issue-46855.rs` [issue](https://github.com/rust-lang/rust/issues/46855) | `mir/` | `dont-use-operand-as-place-for-zst.rs` |
| `issue-47486.rs` [issue](https://github.com/rust-lang/rust/issues/47486) | `consts/` | `size_of-requires-type-annotation-in-const.rs` |
| `issue-47486.stderr` | `consts/` | `size_of-requires-type-annotation-in-const.stderr` |
| `issue-50811.rs` [issue](https://github.com/rust-lang/rust/issues/50811) | `mir/` | `validate-various-comparison-behavior.rs` |
2026-05-20 15:37:30 +02:00
Zalathar
cda9a68248 Rename //@ ignore-pass to //@ no-pass-override
By convention, compiletest directives starting with `ignore-*` normally cause
the test itself to be skipped under certain conditions.

The `//@ ignore-pass` directive was the only exception to that convention. The
new name should hopefully do a better job of communicating its effect, which is
to cause the `--pass` flag to not override the test's `build-pass` or
`run-pass` directive.

The `//@ no-pass-override` directive is mainly useful for tests that expect
warnings produced during codegen.
2026-05-13 17:24:59 +10:00
lokirithm
664af6990b Update files 2026-05-13 01:26:32 +05:30
lokirithm
ee5f63f888 Move test files from issues/ to appropriate subdirectories 2026-05-13 01:15:59 +05:30
danieljofficial
769c3a9a12 add issue links and bless 2026-05-05 16:01:33 +01:00
danieljofficial
3c45cc96e6 move codegen tests into its folder 2026-05-05 15:36:17 +01:00
Wesley Wiser
88922e3d11 Add regression test for LLVM bug with huge stack frames
Regression test for https://github.com/rust-lang/rust/issues/83060
2026-04-27 20:14:10 -05:00
sayantn
a5372be2a1 Add target arch verification for LLVM intrinsics 2026-04-12 23:33:27 +05:30
sayantn
c21f4ee437 Check for AutoUpgraded intrinsics, and lint on uses of deprecated intrinsics 2026-04-12 23:33:15 +05:30
sayantn
aa1a5f8a93 Codegen non-overloaded LLVM intrinsics using their name 2026-04-12 19:00:17 +05:30
ujjwalVishwakarma2006
ff29b41054 Add issue link at the top in files tests/ui/codegen/box-str-drop-glue.rs and tests/ui/drop/drop-noncopyable-raw-pointer.rs 2026-03-26 03:12:06 +05:30
ujjwalVishwakarma2006
f7b3e88947 Rename two test files 2026-03-26 01:50:12 +05:30
cyrgani
9b0be7857a allow incomplete_features in most UI tests 2026-03-21 20:10:07 +00:00
AprilNEA
36f86f9e6a Adds a regression test for 137823 2025-12-30 19:52:02 +08:00
Guillaume Gomez
a8051a6ca3 Ignore more failing ui tests for GCC backend 2025-10-13 15:30:26 +02:00
bors
36e4f5d1fe Auto merge of #146096 - adwinwhite:handle_normalization_overflow_in_mono1, r=saethlin
Fix normalization overflow ICEs in monomorphization

Fixes rust-lang/rust#92004
Fixes rust-lang/rust#92470
Fixes rust-lang/rust#95134
Fixes rust-lang/rust#105275
Fixes rust-lang/rust#105937
Fixes rust-lang/rust#117696-2
Fixes rust-lang/rust#118590
Fixes rust-lang/rust#122823
Fixes rust-lang/rust#131342
Fixes rust-lang/rust#139659

## Analysis:
The causes of these issues are similar. They contain generic recursive functions that can be instantiated with different args infinitely at monomorphization stage.
Ideally this should be caught by the [`check_recursion_limit`](c0bb3b98bb/compiler/rustc_monomorphize/src/collector.rs (L468)) function. The reality is that normalization can reach recursion limit earlier than monomorphization's check because they calculate depths in different ways.
Since normalization is called everywhere, ICEs appear in different locations.

## Fix:
If we abort on overflow with `TypingMode::PostAnalysis` in the trait solver, it would also catch these errors.
The main challenge is providing good diagnostics for them. So it's quite natural to put the check right before these normalization happening.
I first tried to check the whole MIR body's normalization and `references_error`. (As elaborate_drop handles normalization failure by [returning `ty::Error`](c0bb3b98bb/compiler/rustc_mir_transform/src/elaborate_drop.rs (L514-L519)).)
It turns out that checking all `Local`s seems sufficient.
These types are gonna be normalized anyway. So with cache, these checks shouldn't be expensive.

This fixes these ICEs for both the next and old solver, though I'm not sure the change I made to the old solver is proper. Its overflow handling looks convoluted thus I didn't try to fix it more "upstream".
2025-10-13 00:20:10 +00:00
Oneirical
6ca69812cd Add test batch 4 2025-10-11 21:59:51 -04:00
Adwin White
08f16a9c46 check normalization overflow in monomorphization 2025-10-12 06:59:10 +08:00
Guillaume Gomez
a535c7be54 Ignore more failing ui tests for GCC backend 2025-09-26 15:33:48 +02:00
Jacob Pratt
82bb6d523b Rollup merge of #145896 - Oneirical:uncountable-integer-10, r=jieyouxu
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#3 of Batch #2]

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
2025-09-13 03:26:02 -04:00
Oneirical
957fa10d50 Add test batch 3 2025-09-12 14:45:12 -04:00
Sasha Pourcelot
5c4b61b4b4 don't uppercase error messages
a more general version of https://github.com/rust-lang/rust/pull/146080.

after a bit of hacking in [`fluent.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_fluent_macro/src/fluent.rs), i discovered that i'm not the only one that is bad at following guidelines 😅. this pr lowercases the first letter of all the error messages in the codebase.

(i did not change things that are traditionally uppercased such as _MIR_, _ABI_ or _C_)

i think it's reasonable to run a `@bors try` so all the test suite is checked, as i cannot run some of the tests on my machine. i double checked (and replaced manually) all the old error messages, but better be safe than sorry.

in the future i will try to add a check in `x test tidy` that errors if an error message starts with an uppercase letter.
2025-09-03 15:24:49 +02:00
Matthias Krüger
0e28b4201a Rollup merge of #144443 - WaffleLapkin:integer-target-pointer-width, r=Noratrieb
Make target pointer width in target json an integer

r? Noratrieb
cc `@RalfJung` (https://github.com/rust-lang/rust/pull/142352/files#r2230380120)

try-job: x86_64-rust-for-linux
2025-08-31 13:40:34 +02:00
Matthias Krüger
47f1df5ca3 Rollup merge of #145676 - Oneirical:uncountable-integer-9, r=jieyouxu
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#2 of Batch #2]

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
2025-08-29 12:37:30 +02:00
Matthias Krüger
e15744e7a4 Rollup merge of #145675 - Oneirical:uncountable-integer-8, r=jieyouxu
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#1 of Batch #2]

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
2025-08-29 12:37:30 +02:00
Waffle Lapkin
6a3187af13 fix target-pointer-width in tests 2025-08-27 23:44:49 +02:00
Oneirical
2dc4638c46 Add test batch 2 2025-08-27 15:06:05 -04:00