Commit Graph

45 Commits

Author SHA1 Message Date
Esteban Küber 4a27be6972 Do not mention -Zmacro-backtrace for std macros that are a wrapper around a compiler intrinsic 2026-01-26 17:34:31 +00:00
joboet ee24f22b7c update UI tests 2026-01-21 19:20:04 +01:00
Boxy 8a573580f8 Fix terminal dependent tests 2026-01-19 18:54:02 +00:00
reddevilmidzy cd618a9ccb Merge missing_non_modrs with modules 2025-11-28 21:40:59 +09:00
reddevilmidzy 8e74c6b137 Relocate modules_and_files_visibility/mod_file_disambig.rs to
modules/mod_file_disambig.rs

add

fix
2025-11-28 21:40:35 +09:00
reddevilmidzy 58a802e629 Relocate modules_ans_files_visibity/mod_file_correct_spans.rs to
modules/mod_file_correct_spans.rs
2025-11-28 21:40:14 +09: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
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
Oneirical 2dc4638c46 Add test batch 2 2025-08-27 15:06:05 -04:00
Oneirical 2e659f5894 Add test batch 1 2025-08-27 00:23:26 -04:00
Esteban Küber 625143bac3 Add link to docs on malformed attributes 2025-08-11 16:00:49 +00:00
Jakub Beránek e89ae47b97 Rollup merge of #144552 - Oneirical:uncountable-integer-3, r=jieyouxu
Rehome 33 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`

rust-lang/rust#143902 divided into smaller, easier to review chunks.

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-06 15:55:42 +02:00
Oneirical 7196d8cd66 Rehome tests/ui/issues/ tests [3/?] 2025-08-04 16:43:53 -04:00
Scott Schafer aa9767290e feat: Right align line numbers 2025-07-28 16:32:11 -06:00
Kivooeo 98934707eb cleaned up some tests
Additionally, remove unused `tests/ui/auxiliary/svh-*` crates that are duplicates of `tests/ui/svh/auxiliary/svh-*`.
2025-07-13 00:03:31 +05:00
Kivooeo 47b8a32ca3 moved tests 2025-07-13 00:03:31 +05:00
Matthias Krüger 66799d0b83 Rollup merge of #143303 - Kivooeo:tf28, r=tgross35
`tests/ui`: A New Order [28/28] FINAL PART

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? ``@tgross35``
2025-07-11 07:35:19 +02:00
Kivooeo 259512e3b6 cleaned up some tests 2025-07-10 18:50:35 +05:00
Kivooeo 1fb5e0149f moved tests 2025-07-01 23:33:59 +05:00
Kivooeo 1daba45636 cleaned up some tests 2025-07-01 16:26:57 +05:00
Trevor Gross 3b57db4d87 Give some UI tests more apropriate names
Prepare for rework done by the rest of RUST-142440.

Co-authored-by: Kivooeo <Kivooeo123@gmail.com>
2025-07-01 16:26:56 +05:00
dianqk 384d699893 Rollup merge of #142429 - Kivooeo:tf13, r=jieyouxu
`tests/ui`: A New Order [13/N]

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? ```@jieyouxu```
2025-06-30 19:23:14 +08:00
Kivooeo d0bd27924e cleaned up some tests 2025-06-29 15:37:33 +05:00
bendn 57cb419cc5 tests 2025-06-27 12:07:52 +07:00
mejrs 29ce695cd4 Stop dbg! macro yapping about format modifiers 2025-06-22 10:58:27 +02:00
mejrs b1d18129d1 Implement DesugaringKind::FormatLiteral 2025-06-22 10:58:25 +02:00
Kivooeo c6c55cc0cb cleaned up some tests 2025-06-11 20:51:49 +05:00
reddevilmidzy db2a73e284 Cleaned up 5 tests in tests/ui 2025-04-25 20:50:57 +09:00
Jieyou Xu 89cac55bb8 tests: use //@ ignore-auxiliary with backlinked primary test file 2025-04-17 19:45:28 +08:00
Vadim Petrochenkov 5c160f511e compiletest: Stricter parsing for diagnostic kinds 2025-04-07 19:13:31 +03:00
Esteban Küber 57dd42d613 Point at invalid utf-8 span on user's source code
```
error: couldn't read `$DIR/not-utf8-bin-file.rs`: stream did not contain valid UTF-8
  --> $DIR/not-utf8-2.rs:6:5
   |
LL |     include!("not-utf8-bin-file.rs");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: `[193]` is not valid utf-8
  --> $DIR/not-utf8-bin-file.rs:2:14
   |
LL |     let _ = "�|�␂!5�cc␕␂��";
   |              ^
   = note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
```

When we attempt to load a Rust source code file, if there is a OS file failure we try reading the file as bytes. If that succeeds we try to turn it into UTF-8. If *that* fails, we provide additional context about *where* the file has the first invalid UTF-8 character.

Fix #76869.
2025-01-22 00:52:27 +00:00
Zalathar 835fbcbcab Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
许杰友 Jieyou Xu (Joe) 95ff642797 tests: remove //@ pretty-expanded usages
Done with

```bash
sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs
```

and

```
sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs
```
2024-11-26 02:50:48 +08:00
Esteban Küber 5b54286640 Remove detail from label/note that is already available in other note
Remove the "which is required by `{root_obligation}`" post-script in
"the trait `X` is not implemented for `Y`" explanation in E0277. This
information is already conveyed in the notes explaining requirements,
making it redundant while making the text (particularly in labels)
harder to read.

```
error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
  --> $DIR/wf-static-type.rs:10:13
   |
LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
   |             ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`
   |
   = note: required for `Option<NotCopy>` to implement `Copy`
note: required by a bound in `IsCopy`
  --> $DIR/wf-static-type.rs:7:17
   |
LL | struct IsCopy<T:Copy> { t: T }
   |                 ^^^^ required by this bound in `IsCopy`
```
vs the prior

```
error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
  --> $DIR/wf-static-type.rs:10:13
   |
LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
   |             ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`, which is required by `Option<NotCopy>: Copy`
   |
   = note: required for `Option<NotCopy>` to implement `Copy`
note: required by a bound in `IsCopy`
  --> $DIR/wf-static-type.rs:7:17
   |
LL | struct IsCopy<T:Copy> { t: T }
   |                 ^^^^ required by this bound in `IsCopy`
```
2024-10-29 16:26:57 +00:00
Caio ab8994d93e Move tests 2024-04-07 17:38:07 -03:00
许杰友 Jieyou Xu (Joe) ec2cc761bc [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
Esteban Küber 6efddac288 Provide more context on derived obligation error primary label
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote:

```
error[E0277]: the trait bound `i32: Bar` is not satisfied
 --> f100.rs:6:6
  |
6 |     <i32 as Foo>::foo();
  |      ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo`
  |
help: this trait has no implementations, consider adding one
 --> f100.rs:2:1
  |
2 | trait Bar {}
  | ^^^^^^^^^
note: required for `i32` to implement `Foo`
 --> f100.rs:3:14
  |
3 | impl<T: Bar> Foo for T {}
  |         ---  ^^^     ^
  |         |
  |         unsatisfied trait bound introduced here
```

Fix #40120.
2024-01-30 21:28:18 +00:00
Nilstrieb 41e8d152dc Show number in error message even for one error
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-24 19:15:52 +01:00
Esteban Küber 2cca435717 Mention the syntax for use on mod foo; if foo doesn't exist
Newcomers might get confused that `mod` is the only way of defining
scopes, and that it can be used as if it were `use`.

Fix #69492.
2023-10-21 15:56:01 +00:00
clubby789 20a3b9a215 Use the correct span for displaying the line following a derive suggestion 2023-07-19 23:48:43 +00:00
Esteban Küber 5b40aa5eb4 Tweak output for 'add line' suggestion 2023-04-12 22:50:10 +00:00
Pietro Albini 64af509377 remove invalid ignore-pretty 2023-04-03 09:24:11 +02:00
bohan 7615045ebd test: snapshot for derive suggestion in diff files 2023-02-09 22:28:53 +08:00
Albert Larsan cf2dff2b1e Move /src/test to /tests 2023-01-11 09:32:08 +00:00