From 61ea83db4197587424b7a2c5c3c0a792b9e36188 Mon Sep 17 00:00:00 2001 From: cyrgani Date: Mon, 30 Mar 2026 20:39:42 +0000 Subject: [PATCH 1/3] delete some duplicated tests --- tests/ui/associated-types/issue-47814.rs | 13 ------------- tests/ui/associated-types/issue-47814.stderr | 14 -------------- tests/ui/fn/issue-1900.rs | 2 -- tests/ui/fn/issue-1900.stderr | 9 --------- .../specialization-feature-gate-default.rs | 11 ----------- .../specialization-feature-gate-default.stderr | 15 --------------- 6 files changed, 64 deletions(-) delete mode 100644 tests/ui/associated-types/issue-47814.rs delete mode 100644 tests/ui/associated-types/issue-47814.stderr delete mode 100644 tests/ui/fn/issue-1900.rs delete mode 100644 tests/ui/fn/issue-1900.stderr delete mode 100644 tests/ui/specialization/defaultimpl/specialization-feature-gate-default.rs delete mode 100644 tests/ui/specialization/defaultimpl/specialization-feature-gate-default.stderr diff --git a/tests/ui/associated-types/issue-47814.rs b/tests/ui/associated-types/issue-47814.rs deleted file mode 100644 index 90e8a3bc2f2f4..0000000000000 --- a/tests/ui/associated-types/issue-47814.rs +++ /dev/null @@ -1,13 +0,0 @@ -struct ArpIPv4<'a> { - s: &'a u8 -} - -impl<'a> ArpIPv4<'a> { - const LENGTH: usize = 20; - - pub fn to_buffer() -> [u8; Self::LENGTH] { //~ ERROR generic `Self` types are currently not permitted in anonymous constants - unimplemented!() - } -} - -pub fn main() {} diff --git a/tests/ui/associated-types/issue-47814.stderr b/tests/ui/associated-types/issue-47814.stderr deleted file mode 100644 index 7382426b0ffaa..0000000000000 --- a/tests/ui/associated-types/issue-47814.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: generic `Self` types are currently not permitted in anonymous constants - --> $DIR/issue-47814.rs:8:32 - | -LL | pub fn to_buffer() -> [u8; Self::LENGTH] { - | ^^^^ - | -note: not a concrete type - --> $DIR/issue-47814.rs:5:10 - | -LL | impl<'a> ArpIPv4<'a> { - | ^^^^^^^^^^^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/fn/issue-1900.rs b/tests/ui/fn/issue-1900.rs deleted file mode 100644 index 761bd3170270c..0000000000000 --- a/tests/ui/fn/issue-1900.rs +++ /dev/null @@ -1,2 +0,0 @@ -fn main() { } -//~^ ERROR `main` function is not allowed to have generic parameters diff --git a/tests/ui/fn/issue-1900.stderr b/tests/ui/fn/issue-1900.stderr deleted file mode 100644 index 31fd46c8e2a53..0000000000000 --- a/tests/ui/fn/issue-1900.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0131]: `main` function is not allowed to have generic parameters - --> $DIR/issue-1900.rs:1:8 - | -LL | fn main() { } - | ^^^ `main` cannot have generic parameters - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0131`. diff --git a/tests/ui/specialization/defaultimpl/specialization-feature-gate-default.rs b/tests/ui/specialization/defaultimpl/specialization-feature-gate-default.rs deleted file mode 100644 index 89158b65a6e29..0000000000000 --- a/tests/ui/specialization/defaultimpl/specialization-feature-gate-default.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Check that specialization must be ungated to use the `default` keyword - -trait Foo { - fn foo(&self); -} - -default impl Foo for T { //~ ERROR specialization is unstable - fn foo(&self) {} -} - -fn main() {} diff --git a/tests/ui/specialization/defaultimpl/specialization-feature-gate-default.stderr b/tests/ui/specialization/defaultimpl/specialization-feature-gate-default.stderr deleted file mode 100644 index e28d9c9fa836f..0000000000000 --- a/tests/ui/specialization/defaultimpl/specialization-feature-gate-default.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0658]: specialization is unstable - --> $DIR/specialization-feature-gate-default.rs:7:1 - | -LL | / default impl Foo for T { -LL | | fn foo(&self) {} -LL | | } - | |_^ - | - = note: see issue #31844 for more information - = help: add `#![feature(specialization)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0658`. From d24ebcb47c36519b259a706e0cf3d80bcd293aea Mon Sep 17 00:00:00 2001 From: cyrgani Date: Mon, 30 Mar 2026 20:40:15 +0000 Subject: [PATCH 2/3] rename some `issues-*` tests --- src/tools/tidy/src/issues.txt | 3 --- .../{issue-78720.rs => nested-copy-drops-83176.rs} | 1 + .../{issue-78720.stderr => nested-copy-drops-83176.stderr} | 2 +- tests/ui/impl-trait/rpit/unit-impl-default-36379.rs | 6 ++++++ tests/ui/issues/issue-36379.rs | 5 ----- 5 files changed, 8 insertions(+), 9 deletions(-) rename tests/ui/closures/2229_closure_analysis/migrations/{issue-78720.rs => nested-copy-drops-83176.rs} (77%) rename tests/ui/closures/2229_closure_analysis/migrations/{issue-78720.stderr => nested-copy-drops-83176.stderr} (88%) create mode 100644 tests/ui/impl-trait/rpit/unit-impl-default-36379.rs delete mode 100644 tests/ui/issues/issue-36379.rs diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index f382502c7068b..3b23fe5d80826 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -117,7 +117,6 @@ ui/associated-types/issue-44153.rs ui/associated-types/issue-47139-1.rs ui/associated-types/issue-47139-2.rs ui/associated-types/issue-47385.rs -ui/associated-types/issue-47814.rs ui/associated-types/issue-48010.rs ui/associated-types/issue-48551.rs ui/associated-types/issue-50301.rs @@ -406,7 +405,6 @@ ui/closures/2229_closure_analysis/match/issue-87097.rs ui/closures/2229_closure_analysis/match/issue-87426.rs ui/closures/2229_closure_analysis/match/issue-87988.rs ui/closures/2229_closure_analysis/match/issue-88331.rs -ui/closures/2229_closure_analysis/migrations/issue-78720.rs ui/closures/2229_closure_analysis/migrations/issue-86753.rs ui/closures/2229_closure_analysis/migrations/issue-90024-adt-correct-subst.rs ui/closures/2229_closure_analysis/run_pass/issue-87378.rs @@ -1001,7 +999,6 @@ ui/fmt/issue-86085.rs ui/fmt/issue-89173.rs ui/fmt/issue-91556.rs ui/fn/issue-1451.rs -ui/fn/issue-1900.rs ui/fn/issue-3044.rs ui/fn/issue-3099.rs ui/fn/issue-3904.rs diff --git a/tests/ui/closures/2229_closure_analysis/migrations/issue-78720.rs b/tests/ui/closures/2229_closure_analysis/migrations/nested-copy-drops-83176.rs similarity index 77% rename from tests/ui/closures/2229_closure_analysis/migrations/issue-78720.rs rename to tests/ui/closures/2229_closure_analysis/migrations/nested-copy-drops-83176.rs index 3e72eec4ea8c6..2df8931f7ef7a 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/issue-78720.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/nested-copy-drops-83176.rs @@ -1,3 +1,4 @@ +// Regression test for https://github.com/rust-lang/rust/issues/83176. //@ run-pass #![warn(rust_2021_incompatible_closure_captures)] diff --git a/tests/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr b/tests/ui/closures/2229_closure_analysis/migrations/nested-copy-drops-83176.stderr similarity index 88% rename from tests/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr rename to tests/ui/closures/2229_closure_analysis/migrations/nested-copy-drops-83176.stderr index 2609e2951ec54..595173b49da68 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/nested-copy-drops-83176.stderr @@ -1,5 +1,5 @@ warning: irrefutable `if let` pattern - --> $DIR/issue-78720.rs:7:8 + --> $DIR/nested-copy-drops-83176.rs:8:8 | LL | if let a = "" { | ^^^^^^^^^^ diff --git a/tests/ui/impl-trait/rpit/unit-impl-default-36379.rs b/tests/ui/impl-trait/rpit/unit-impl-default-36379.rs new file mode 100644 index 0000000000000..43c93065739d3 --- /dev/null +++ b/tests/ui/impl-trait/rpit/unit-impl-default-36379.rs @@ -0,0 +1,6 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/36379 +//@ check-pass + +fn _test() -> impl Default { } + +fn main() {} diff --git a/tests/ui/issues/issue-36379.rs b/tests/ui/issues/issue-36379.rs deleted file mode 100644 index 6e275b03a7029..0000000000000 --- a/tests/ui/issues/issue-36379.rs +++ /dev/null @@ -1,5 +0,0 @@ -//@ check-pass - -fn _test() -> impl Default { } - -fn main() {} From 6cd26567db61c85479cdf6192a18f6d6bce43ca8 Mon Sep 17 00:00:00 2001 From: cyrgani Date: Mon, 30 Mar 2026 20:40:27 +0000 Subject: [PATCH 3/3] add more FIXMEs and details to `ui/README.md` --- tests/ui/README.md | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/ui/README.md b/tests/ui/README.md index eb14039d8151a..a9e7f022c2b60 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -36,6 +36,8 @@ These tests exercise the [`annotate-snippets`]-based emitter implementation. [`annotate-snippets`]: https://github.com/rust-lang/annotate-snippets-rs +**FIXME**: merge this with `error-emitter` + ## `tests/ui/anon-params` 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: . @@ -730,6 +734,8 @@ Tests on type inference. Tests for diagnostics on infinitely recursive types without indirection. +**FIXME**: check for overlap with `structs-enums/enum-rec` and `structs-enums/struct-rec` + ## `tests/ui/inline-const/` 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 ## `tests/ui/loop-match` -Tests for `loop` with `match` expressions. +Tests for the `loop_match` feature to optimize `loop`s consisting of one big `match` expressions. + +See [Tracking issue for way to express intraprocedural finite state machines #132306](https://github.com/rust-lang/rust/issues/132306). ## `tests/ui/loops/` @@ -891,6 +899,8 @@ See [Tracking issue for allowing overlapping implementations for marker trait #2 Broad category of tests on `match` constructs. +**FIXME**: many tests overlap with `tests/ui/bindings`, try to reduce duplication. + ## `tests/ui/methods/` 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. Certain mir-opt regression tests. +**FIXME**: many tests in this directory are not about MIR or optimizations, relocate these. + ## `tests/ui/mir-dataflow` Tests for MIR dataflow analysis. @@ -977,6 +989,8 @@ Tests that exercises edge cases, such as specific floats, large or very small nu Tests that checks numeric types and their interactions, such as casting among them with `as` or providing the wrong numeric suffix. +**FIXME**: these tests could get moved to other directories, in particular `cast/` or `parser/`. + ## `tests/ui/object-lifetime/` 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 ## `tests/ui/str/` -Exercise `str` keyword and string slices. +Exercise `str` primitive and string slices. ## `tests/ui/structs/` @@ -1464,6 +1478,8 @@ See [RFC 0132 Unified Function Call Syntax](https://github.com/rust-lang/rfcs/bl `#![feature(unboxed_closures)]`, `Fn`, `FnMut` and `FnOnce` traits +**FIXME**: many tests have `unboxed-closure` in their name but only test normal closures, rename these. + See [Tracking issue for Fn traits (`unboxed_closures` & `fn_traits` feature)](https://github.com/rust-lang/rust/issues/29625). ## `tests/ui/underscore-lifetime/`: `'_` elided lifetime