Skip to content

Commit e9f6a77

Browse files
Rollup merge of #154606 - cyrgani:misc-test-cleanups, r=Kivooeo
misc test cleanups These are some mixed cleanups to `tests/ui` that individually seemed too small for a PR of their own. Some duplicated tests are removed, `issues-*` tests are renamed and more FIXMEs are added to `ui/README.md`. Reasoning for the deleted tests: * `tests/ui/associated-types/issue-47814.rs`: duplicate of `tests/ui/associated-consts/issue-47814.rs` * rename `tests/ui/closures/2229_closure_analysis/migrations/issue-78720.rs` to `.../nested-copy-drops-83176.rs` since #78720 was not the correct issue, #83176 was. * `tests/ui/specialization/defaultimpl/specialization-feature-gate-default.rs`: duplicate of `tests/ui/specialization/specialization-feature-gate-default.rs` * `fn/issue-1900.rs`: duplicate of `error-codes/E0131.rs` r? @Kivooeo
2 parents 6188955 + 6cd2656 commit e9f6a77

12 files changed

Lines changed: 30 additions & 79 deletions

File tree

src/tools/tidy/src/issues.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ ui/associated-types/issue-44153.rs
117117
ui/associated-types/issue-47139-1.rs
118118
ui/associated-types/issue-47139-2.rs
119119
ui/associated-types/issue-47385.rs
120-
ui/associated-types/issue-47814.rs
121120
ui/associated-types/issue-48010.rs
122121
ui/associated-types/issue-48551.rs
123122
ui/associated-types/issue-50301.rs
@@ -406,7 +405,6 @@ ui/closures/2229_closure_analysis/match/issue-87097.rs
406405
ui/closures/2229_closure_analysis/match/issue-87426.rs
407406
ui/closures/2229_closure_analysis/match/issue-87988.rs
408407
ui/closures/2229_closure_analysis/match/issue-88331.rs
409-
ui/closures/2229_closure_analysis/migrations/issue-78720.rs
410408
ui/closures/2229_closure_analysis/migrations/issue-86753.rs
411409
ui/closures/2229_closure_analysis/migrations/issue-90024-adt-correct-subst.rs
412410
ui/closures/2229_closure_analysis/run_pass/issue-87378.rs
@@ -1001,7 +999,6 @@ ui/fmt/issue-86085.rs
1001999
ui/fmt/issue-89173.rs
10021000
ui/fmt/issue-91556.rs
10031001
ui/fn/issue-1451.rs
1004-
ui/fn/issue-1900.rs
10051002
ui/fn/issue-3044.rs
10061003
ui/fn/issue-3099.rs
10071004
ui/fn/issue-3904.rs

tests/ui/README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ These tests exercise the [`annotate-snippets`]-based emitter implementation.
3636

3737
[`annotate-snippets`]: https://github.com/rust-lang/annotate-snippets-rs
3838

39+
**FIXME**: merge this with `error-emitter`
40+
3941
## `tests/ui/anon-params`
4042

4143
These tests deal with anonymous parameters (no name, only type), a deprecated feature that becomes a hard error in Edition 2018.
@@ -141,6 +143,8 @@ However, only a single test was ever added to this category: <https://github.com
141143

142144
Tests for pattern binding in match expressions, let statements, and other binding contexts. E.g. binding modes and refutability. See [Patterns | Reference](https://doc.rust-lang.org/reference/patterns.html).
143145

146+
**FIXME**: quite some overlap with `tests/ui/pattern` and `tests/ui/match`.
147+
144148
## `tests/ui/binop/`: Binary operators
145149

146150
Tests for binary operators (such as `==`, `&&` or `^`). E.g. overloading, type checking, and diagnostics for invalid operations.
@@ -272,7 +276,7 @@ This directory is actually for the standard library [`std::process::Command`](ht
272276

273277
Some traits' implementation must be compared with their definition, checking for problems such as the implementation having stricter requirements (such as needing to implement `Copy`).
274278

275-
This subdirectory is *not* intended comparison traits (`PartialEq`, `Eq`, `PartialOrd`, `Ord`).
279+
This subdirectory is *not* intended for comparison traits (`PartialEq`, `Eq`, `PartialOrd`, `Ord`).
276280

277281
## `tests/ui/compile-flags/`
278282

@@ -448,6 +452,8 @@ Exercises diagnostics for when a code block attempts to gain ownership of a non-
448452

449453
Exercises diagnostics for disallowed struct destructuring.
450454

455+
**FIXME**: does this really need to be its own immediate subdirectory?
456+
451457
## `tests/ui/dist`
452458

453459
Tests that require distribution artifacts.
@@ -508,7 +514,7 @@ These tests run in specific Rust editions, such as Rust 2015 or Rust 2018, and c
508514

509515
## `tests/ui/eii`: Externally Implementable Items
510516

511-
Exercises `eii` keyword.
517+
Exercises the `#[eii]` attribute and related features.
512518

513519
## `tests/ui/entry-point/`: `main` function
514520

@@ -611,8 +617,6 @@ Tests for `#![feature(fn_traits)]`. See [`fn_traits` | The Unstable book](https:
611617

612618
Anything to do with loops and `for`, `loop` and `while` keywords to express them.
613619

614-
**FIXME**: After `ui/for` is merged into this, also carry over its SUMMARY text.
615-
616620
## `tests/ui/force-inlining/`: `#[rustc_force_inline]`
617621

618622
Tests for `#[rustc_force_inline]`, which will force a function to always be labelled as inline by the compiler (it will be inserted at the point of its call instead of being used as a normal function call.) If the compiler is unable to inline the function, an error will be reported. See <https://github.com/rust-lang/rust/pull/134082>.
@@ -730,6 +734,8 @@ Tests on type inference.
730734

731735
Tests for diagnostics on infinitely recursive types without indirection.
732736

737+
**FIXME**: check for overlap with `structs-enums/enum-rec` and `structs-enums/struct-rec`
738+
733739
## `tests/ui/inline-const/`
734740

735741
These tests revolve around the inline `const` block that forces the compiler to const-eval its content.
@@ -853,7 +859,9 @@ Tests exercising analysis for unused variables, unreachable statements, function
853859

854860
## `tests/ui/loop-match`
855861

856-
Tests for `loop` with `match` expressions.
862+
Tests for the `loop_match` feature to optimize `loop`s consisting of one big `match` expressions.
863+
864+
See [Tracking issue for way to express intraprocedural finite state machines #132306](https://github.com/rust-lang/rust/issues/132306).
857865

858866
## `tests/ui/loops/`
859867

@@ -891,6 +899,8 @@ See [Tracking issue for allowing overlapping implementations for marker trait #2
891899

892900
Broad category of tests on `match` constructs.
893901

902+
**FIXME**: many tests overlap with `tests/ui/bindings`, try to reduce duplication.
903+
894904
## `tests/ui/methods/`
895905

896906
A broad category for anything related to methods and method resolution.
@@ -899,6 +909,8 @@ A broad category for anything related to methods and method resolution.
899909

900910
Certain mir-opt regression tests.
901911

912+
**FIXME**: many tests in this directory are not about MIR or optimizations, relocate these.
913+
902914
## `tests/ui/mir-dataflow`
903915

904916
Tests for MIR dataflow analysis.
@@ -977,6 +989,8 @@ Tests that exercises edge cases, such as specific floats, large or very small nu
977989

978990
Tests that checks numeric types and their interactions, such as casting among them with `as` or providing the wrong numeric suffix.
979991

992+
**FIXME**: these tests could get moved to other directories, in particular `cast/` or `parser/`.
993+
980994
## `tests/ui/object-lifetime/`
981995

982996
Tests on lifetimes on objects, such as a lifetime bound not being able to be deduced from context, or checking that lifetimes are inherited properly.
@@ -1308,7 +1322,7 @@ Some standard library tests which are too inconvenient or annoying to implement
13081322

13091323
## `tests/ui/str/`
13101324

1311-
Exercise `str` keyword and string slices.
1325+
Exercise `str` primitive and string slices.
13121326

13131327
## `tests/ui/structs/`
13141328

@@ -1464,6 +1478,8 @@ See [RFC 0132 Unified Function Call Syntax](https://github.com/rust-lang/rfcs/bl
14641478

14651479
`#![feature(unboxed_closures)]`, `Fn`, `FnMut` and `FnOnce` traits
14661480

1481+
**FIXME**: many tests have `unboxed-closure` in their name but only test normal closures, rename these.
1482+
14671483
See [Tracking issue for Fn traits (`unboxed_closures` & `fn_traits` feature)](https://github.com/rust-lang/rust/issues/29625).
14681484

14691485
## `tests/ui/underscore-lifetime/`: `'_` elided lifetime

tests/ui/associated-types/issue-47814.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/ui/associated-types/issue-47814.stderr

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/ui/closures/2229_closure_analysis/migrations/issue-78720.rs renamed to tests/ui/closures/2229_closure_analysis/migrations/nested-copy-drops-83176.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Regression test for https://github.com/rust-lang/rust/issues/83176.
12
//@ run-pass
23

34
#![warn(rust_2021_incompatible_closure_captures)]

tests/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr renamed to tests/ui/closures/2229_closure_analysis/migrations/nested-copy-drops-83176.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: irrefutable `if let` pattern
2-
--> $DIR/issue-78720.rs:7:8
2+
--> $DIR/nested-copy-drops-83176.rs:8:8
33
|
44
LL | if let a = "" {
55
| ^^^^^^^^^^

tests/ui/fn/issue-1900.rs

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/ui/fn/issue-1900.stderr

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/36379
2+
//@ check-pass
3+
4+
fn _test() -> impl Default { }
5+
6+
fn main() {}

tests/ui/issues/issue-36379.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)