From 09f9947ebc68a8199c3dff8607a41571c48cc377 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 28 Sep 2019 16:05:38 +0200 Subject: [PATCH] Gather together usefulness tests I took most tests that were testing only for match exhaustiveness, pattern refutability or match arm reachability, and put them in the same test folder. --- src/librustc_mir/hair/pattern/_match.rs | 3 +++ .../usefulness}/always-inhabited-union-ref.rs | 0 .../usefulness}/always-inhabited-union-ref.stderr | 0 .../{ => pattern/usefulness}/exhaustive_integer_patterns.rs | 0 .../usefulness}/exhaustive_integer_patterns.stderr | 0 .../ui/{ => pattern/usefulness}/guards-not-exhaustive.rs | 0 .../irrefutable-exhaustive-integer-binding.rs | 0 src/test/ui/{ => pattern/usefulness}/irrefutable-unit.rs | 0 .../ui/{check_match => pattern/usefulness}/issue-35609.rs | 0 .../{check_match => pattern/usefulness}/issue-35609.stderr | 0 .../ui/{check_match => pattern/usefulness}/issue-43253.rs | 0 .../{check_match => pattern/usefulness}/issue-43253.stderr | 0 .../usefulness/match-arm-statics-2.rs} | 0 .../usefulness/match-arm-statics-2.stderr} | 6 +++--- .../ui/{match => pattern/usefulness}/match-arm-statics.rs | 0 .../{match => pattern/usefulness}/match-arm-statics.stderr | 0 .../usefulness}/match-byte-array-patterns-2.rs | 0 .../usefulness}/match-byte-array-patterns-2.stderr | 0 .../usefulness}/match-byte-array-patterns.rs | 0 .../usefulness}/match-byte-array-patterns.stderr | 0 .../{match => pattern/usefulness}/match-non-exhaustive.rs | 0 .../usefulness}/match-non-exhaustive.stderr | 0 .../{match => pattern/usefulness}/match-privately-empty.rs | 0 .../usefulness}/match-privately-empty.stderr | 0 .../usefulness}/match-range-fail-dominate.rs | 0 .../usefulness}/match-range-fail-dominate.stderr | 0 src/test/ui/{match => pattern/usefulness}/match-ref-ice.rs | 0 .../ui/{match => pattern/usefulness}/match-ref-ice.stderr | 0 .../{match => pattern/usefulness}/match-slice-patterns.rs | 0 .../usefulness}/match-slice-patterns.stderr | 0 .../ui/{match => pattern/usefulness}/match-vec-fixed.rs | 0 .../ui/{match => pattern/usefulness}/match-vec-fixed.stderr | 0 .../{match => pattern/usefulness}/match-vec-unreachable.rs | 0 .../usefulness}/match-vec-unreachable.stderr | 0 .../usefulness}/nested-exhaustive-match.rs | 0 .../usefulness}/non-exhaustive-defined-here.rs | 0 .../usefulness}/non-exhaustive-defined-here.stderr | 0 .../usefulness}/non-exhaustive-float-range-match.rs | 0 .../usefulness}/non-exhaustive-float-range-match.stderr | 0 .../usefulness}/non-exhaustive-match-nested.rs | 0 .../usefulness}/non-exhaustive-match-nested.stderr | 0 .../usefulness}/non-exhaustive-match.rs | 0 .../usefulness}/non-exhaustive-match.stderr | 0 .../usefulness}/non-exhaustive-pattern-witness.rs | 0 .../usefulness}/non-exhaustive-pattern-witness.stderr | 0 .../ui/{ => pattern/usefulness}/refutable-pattern-errors.rs | 0 .../usefulness}/refutable-pattern-errors.stderr | 0 .../{ => pattern/usefulness}/refutable-pattern-in-fn-arg.rs | 0 .../usefulness}/refutable-pattern-in-fn-arg.stderr | 0 .../usefulness}/struct-like-enum-nonexhaustive.rs | 0 .../usefulness}/struct-like-enum-nonexhaustive.stderr | 0 .../usefulness}/struct-pattern-match-useless.rs | 0 .../usefulness}/struct-pattern-match-useless.stderr | 0 .../usefulness}/tuple-struct-nonexhaustive.rs | 0 .../usefulness}/tuple-struct-nonexhaustive.stderr | 0 55 files changed, 6 insertions(+), 3 deletions(-) rename src/test/ui/{uninhabited => pattern/usefulness}/always-inhabited-union-ref.rs (100%) rename src/test/ui/{uninhabited => pattern/usefulness}/always-inhabited-union-ref.stderr (100%) rename src/test/ui/{ => pattern/usefulness}/exhaustive_integer_patterns.rs (100%) rename src/test/ui/{ => pattern/usefulness}/exhaustive_integer_patterns.stderr (100%) rename src/test/ui/{ => pattern/usefulness}/guards-not-exhaustive.rs (100%) rename src/test/ui/pattern/{ => usefulness}/irrefutable-exhaustive-integer-binding.rs (100%) rename src/test/ui/{ => pattern/usefulness}/irrefutable-unit.rs (100%) rename src/test/ui/{check_match => pattern/usefulness}/issue-35609.rs (100%) rename src/test/ui/{check_match => pattern/usefulness}/issue-35609.stderr (100%) rename src/test/ui/{check_match => pattern/usefulness}/issue-43253.rs (100%) rename src/test/ui/{check_match => pattern/usefulness}/issue-43253.stderr (100%) rename src/test/ui/{match/match-argm-statics-2.rs => pattern/usefulness/match-arm-statics-2.rs} (100%) rename src/test/ui/{match/match-argm-statics-2.stderr => pattern/usefulness/match-arm-statics-2.stderr} (90%) rename src/test/ui/{match => pattern/usefulness}/match-arm-statics.rs (100%) rename src/test/ui/{match => pattern/usefulness}/match-arm-statics.stderr (100%) rename src/test/ui/{match => pattern/usefulness}/match-byte-array-patterns-2.rs (100%) rename src/test/ui/{match => pattern/usefulness}/match-byte-array-patterns-2.stderr (100%) rename src/test/ui/{match => pattern/usefulness}/match-byte-array-patterns.rs (100%) rename src/test/ui/{match => pattern/usefulness}/match-byte-array-patterns.stderr (100%) rename src/test/ui/{match => pattern/usefulness}/match-non-exhaustive.rs (100%) rename src/test/ui/{match => pattern/usefulness}/match-non-exhaustive.stderr (100%) rename src/test/ui/{match => pattern/usefulness}/match-privately-empty.rs (100%) rename src/test/ui/{match => pattern/usefulness}/match-privately-empty.stderr (100%) rename src/test/ui/{match => pattern/usefulness}/match-range-fail-dominate.rs (100%) rename src/test/ui/{match => pattern/usefulness}/match-range-fail-dominate.stderr (100%) rename src/test/ui/{match => pattern/usefulness}/match-ref-ice.rs (100%) rename src/test/ui/{match => pattern/usefulness}/match-ref-ice.stderr (100%) rename src/test/ui/{match => pattern/usefulness}/match-slice-patterns.rs (100%) rename src/test/ui/{match => pattern/usefulness}/match-slice-patterns.stderr (100%) rename src/test/ui/{match => pattern/usefulness}/match-vec-fixed.rs (100%) rename src/test/ui/{match => pattern/usefulness}/match-vec-fixed.stderr (100%) rename src/test/ui/{match => pattern/usefulness}/match-vec-unreachable.rs (100%) rename src/test/ui/{match => pattern/usefulness}/match-vec-unreachable.stderr (100%) rename src/test/ui/{binding => pattern/usefulness}/nested-exhaustive-match.rs (100%) rename src/test/ui/{match => pattern/usefulness}/non-exhaustive-defined-here.rs (100%) rename src/test/ui/{match => pattern/usefulness}/non-exhaustive-defined-here.stderr (100%) rename src/test/ui/{non-exhaustive => pattern/usefulness}/non-exhaustive-float-range-match.rs (100%) rename src/test/ui/{non-exhaustive => pattern/usefulness}/non-exhaustive-float-range-match.stderr (100%) rename src/test/ui/{non-exhaustive => pattern/usefulness}/non-exhaustive-match-nested.rs (100%) rename src/test/ui/{non-exhaustive => pattern/usefulness}/non-exhaustive-match-nested.stderr (100%) rename src/test/ui/{non-exhaustive => pattern/usefulness}/non-exhaustive-match.rs (100%) rename src/test/ui/{non-exhaustive => pattern/usefulness}/non-exhaustive-match.stderr (100%) rename src/test/ui/{non-exhaustive => pattern/usefulness}/non-exhaustive-pattern-witness.rs (100%) rename src/test/ui/{non-exhaustive => pattern/usefulness}/non-exhaustive-pattern-witness.stderr (100%) rename src/test/ui/{ => pattern/usefulness}/refutable-pattern-errors.rs (100%) rename src/test/ui/{ => pattern/usefulness}/refutable-pattern-errors.stderr (100%) rename src/test/ui/{ => pattern/usefulness}/refutable-pattern-in-fn-arg.rs (100%) rename src/test/ui/{ => pattern/usefulness}/refutable-pattern-in-fn-arg.stderr (100%) rename src/test/ui/{structs => pattern/usefulness}/struct-like-enum-nonexhaustive.rs (100%) rename src/test/ui/{structs => pattern/usefulness}/struct-like-enum-nonexhaustive.stderr (100%) rename src/test/ui/{structs => pattern/usefulness}/struct-pattern-match-useless.rs (100%) rename src/test/ui/{structs => pattern/usefulness}/struct-pattern-match-useless.stderr (100%) rename src/test/ui/{tuple => pattern/usefulness}/tuple-struct-nonexhaustive.rs (100%) rename src/test/ui/{tuple => pattern/usefulness}/tuple-struct-nonexhaustive.stderr (100%) diff --git a/src/librustc_mir/hair/pattern/_match.rs b/src/librustc_mir/hair/pattern/_match.rs index 907c84b6f8cf0..0009524ef6f93 100644 --- a/src/librustc_mir/hair/pattern/_match.rs +++ b/src/librustc_mir/hair/pattern/_match.rs @@ -1,3 +1,6 @@ +/// Note: most tests relevant to this file can be found (at the time of writing) +/// in src/tests/ui/pattern/usefulness. +/// /// This file includes the logic for exhaustiveness and usefulness checking for /// pattern-matching. Specifically, given a list of patterns for a type, we can /// tell whether: diff --git a/src/test/ui/uninhabited/always-inhabited-union-ref.rs b/src/test/ui/pattern/usefulness/always-inhabited-union-ref.rs similarity index 100% rename from src/test/ui/uninhabited/always-inhabited-union-ref.rs rename to src/test/ui/pattern/usefulness/always-inhabited-union-ref.rs diff --git a/src/test/ui/uninhabited/always-inhabited-union-ref.stderr b/src/test/ui/pattern/usefulness/always-inhabited-union-ref.stderr similarity index 100% rename from src/test/ui/uninhabited/always-inhabited-union-ref.stderr rename to src/test/ui/pattern/usefulness/always-inhabited-union-ref.stderr diff --git a/src/test/ui/exhaustive_integer_patterns.rs b/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.rs similarity index 100% rename from src/test/ui/exhaustive_integer_patterns.rs rename to src/test/ui/pattern/usefulness/exhaustive_integer_patterns.rs diff --git a/src/test/ui/exhaustive_integer_patterns.stderr b/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.stderr similarity index 100% rename from src/test/ui/exhaustive_integer_patterns.stderr rename to src/test/ui/pattern/usefulness/exhaustive_integer_patterns.stderr diff --git a/src/test/ui/guards-not-exhaustive.rs b/src/test/ui/pattern/usefulness/guards-not-exhaustive.rs similarity index 100% rename from src/test/ui/guards-not-exhaustive.rs rename to src/test/ui/pattern/usefulness/guards-not-exhaustive.rs diff --git a/src/test/ui/pattern/irrefutable-exhaustive-integer-binding.rs b/src/test/ui/pattern/usefulness/irrefutable-exhaustive-integer-binding.rs similarity index 100% rename from src/test/ui/pattern/irrefutable-exhaustive-integer-binding.rs rename to src/test/ui/pattern/usefulness/irrefutable-exhaustive-integer-binding.rs diff --git a/src/test/ui/irrefutable-unit.rs b/src/test/ui/pattern/usefulness/irrefutable-unit.rs similarity index 100% rename from src/test/ui/irrefutable-unit.rs rename to src/test/ui/pattern/usefulness/irrefutable-unit.rs diff --git a/src/test/ui/check_match/issue-35609.rs b/src/test/ui/pattern/usefulness/issue-35609.rs similarity index 100% rename from src/test/ui/check_match/issue-35609.rs rename to src/test/ui/pattern/usefulness/issue-35609.rs diff --git a/src/test/ui/check_match/issue-35609.stderr b/src/test/ui/pattern/usefulness/issue-35609.stderr similarity index 100% rename from src/test/ui/check_match/issue-35609.stderr rename to src/test/ui/pattern/usefulness/issue-35609.stderr diff --git a/src/test/ui/check_match/issue-43253.rs b/src/test/ui/pattern/usefulness/issue-43253.rs similarity index 100% rename from src/test/ui/check_match/issue-43253.rs rename to src/test/ui/pattern/usefulness/issue-43253.rs diff --git a/src/test/ui/check_match/issue-43253.stderr b/src/test/ui/pattern/usefulness/issue-43253.stderr similarity index 100% rename from src/test/ui/check_match/issue-43253.stderr rename to src/test/ui/pattern/usefulness/issue-43253.stderr diff --git a/src/test/ui/match/match-argm-statics-2.rs b/src/test/ui/pattern/usefulness/match-arm-statics-2.rs similarity index 100% rename from src/test/ui/match/match-argm-statics-2.rs rename to src/test/ui/pattern/usefulness/match-arm-statics-2.rs diff --git a/src/test/ui/match/match-argm-statics-2.stderr b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr similarity index 90% rename from src/test/ui/match/match-argm-statics-2.stderr rename to src/test/ui/pattern/usefulness/match-arm-statics-2.stderr index 8c54e030823af..8521e37d3fddc 100644 --- a/src/test/ui/match/match-argm-statics-2.stderr +++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: `(true, false)` not covered - --> $DIR/match-argm-statics-2.rs:17:11 + --> $DIR/match-arm-statics-2.rs:17:11 | LL | match (true, false) { | ^^^^^^^^^^^^^ pattern `(true, false)` not covered @@ -7,7 +7,7 @@ LL | match (true, false) { = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms error[E0004]: non-exhaustive patterns: `Some(Some(West))` not covered - --> $DIR/match-argm-statics-2.rs:29:11 + --> $DIR/match-arm-statics-2.rs:29:11 | LL | match Some(Some(North)) { | ^^^^^^^^^^^^^^^^^ pattern `Some(Some(West))` not covered @@ -15,7 +15,7 @@ LL | match Some(Some(North)) { = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms error[E0004]: non-exhaustive patterns: `Foo { bar: Some(North), baz: NewBool(true) }` not covered - --> $DIR/match-argm-statics-2.rs:48:11 + --> $DIR/match-arm-statics-2.rs:48:11 | LL | / struct Foo { LL | | bar: Option, diff --git a/src/test/ui/match/match-arm-statics.rs b/src/test/ui/pattern/usefulness/match-arm-statics.rs similarity index 100% rename from src/test/ui/match/match-arm-statics.rs rename to src/test/ui/pattern/usefulness/match-arm-statics.rs diff --git a/src/test/ui/match/match-arm-statics.stderr b/src/test/ui/pattern/usefulness/match-arm-statics.stderr similarity index 100% rename from src/test/ui/match/match-arm-statics.stderr rename to src/test/ui/pattern/usefulness/match-arm-statics.stderr diff --git a/src/test/ui/match/match-byte-array-patterns-2.rs b/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs similarity index 100% rename from src/test/ui/match/match-byte-array-patterns-2.rs rename to src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs diff --git a/src/test/ui/match/match-byte-array-patterns-2.stderr b/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.stderr similarity index 100% rename from src/test/ui/match/match-byte-array-patterns-2.stderr rename to src/test/ui/pattern/usefulness/match-byte-array-patterns-2.stderr diff --git a/src/test/ui/match/match-byte-array-patterns.rs b/src/test/ui/pattern/usefulness/match-byte-array-patterns.rs similarity index 100% rename from src/test/ui/match/match-byte-array-patterns.rs rename to src/test/ui/pattern/usefulness/match-byte-array-patterns.rs diff --git a/src/test/ui/match/match-byte-array-patterns.stderr b/src/test/ui/pattern/usefulness/match-byte-array-patterns.stderr similarity index 100% rename from src/test/ui/match/match-byte-array-patterns.stderr rename to src/test/ui/pattern/usefulness/match-byte-array-patterns.stderr diff --git a/src/test/ui/match/match-non-exhaustive.rs b/src/test/ui/pattern/usefulness/match-non-exhaustive.rs similarity index 100% rename from src/test/ui/match/match-non-exhaustive.rs rename to src/test/ui/pattern/usefulness/match-non-exhaustive.rs diff --git a/src/test/ui/match/match-non-exhaustive.stderr b/src/test/ui/pattern/usefulness/match-non-exhaustive.stderr similarity index 100% rename from src/test/ui/match/match-non-exhaustive.stderr rename to src/test/ui/pattern/usefulness/match-non-exhaustive.stderr diff --git a/src/test/ui/match/match-privately-empty.rs b/src/test/ui/pattern/usefulness/match-privately-empty.rs similarity index 100% rename from src/test/ui/match/match-privately-empty.rs rename to src/test/ui/pattern/usefulness/match-privately-empty.rs diff --git a/src/test/ui/match/match-privately-empty.stderr b/src/test/ui/pattern/usefulness/match-privately-empty.stderr similarity index 100% rename from src/test/ui/match/match-privately-empty.stderr rename to src/test/ui/pattern/usefulness/match-privately-empty.stderr diff --git a/src/test/ui/match/match-range-fail-dominate.rs b/src/test/ui/pattern/usefulness/match-range-fail-dominate.rs similarity index 100% rename from src/test/ui/match/match-range-fail-dominate.rs rename to src/test/ui/pattern/usefulness/match-range-fail-dominate.rs diff --git a/src/test/ui/match/match-range-fail-dominate.stderr b/src/test/ui/pattern/usefulness/match-range-fail-dominate.stderr similarity index 100% rename from src/test/ui/match/match-range-fail-dominate.stderr rename to src/test/ui/pattern/usefulness/match-range-fail-dominate.stderr diff --git a/src/test/ui/match/match-ref-ice.rs b/src/test/ui/pattern/usefulness/match-ref-ice.rs similarity index 100% rename from src/test/ui/match/match-ref-ice.rs rename to src/test/ui/pattern/usefulness/match-ref-ice.rs diff --git a/src/test/ui/match/match-ref-ice.stderr b/src/test/ui/pattern/usefulness/match-ref-ice.stderr similarity index 100% rename from src/test/ui/match/match-ref-ice.stderr rename to src/test/ui/pattern/usefulness/match-ref-ice.stderr diff --git a/src/test/ui/match/match-slice-patterns.rs b/src/test/ui/pattern/usefulness/match-slice-patterns.rs similarity index 100% rename from src/test/ui/match/match-slice-patterns.rs rename to src/test/ui/pattern/usefulness/match-slice-patterns.rs diff --git a/src/test/ui/match/match-slice-patterns.stderr b/src/test/ui/pattern/usefulness/match-slice-patterns.stderr similarity index 100% rename from src/test/ui/match/match-slice-patterns.stderr rename to src/test/ui/pattern/usefulness/match-slice-patterns.stderr diff --git a/src/test/ui/match/match-vec-fixed.rs b/src/test/ui/pattern/usefulness/match-vec-fixed.rs similarity index 100% rename from src/test/ui/match/match-vec-fixed.rs rename to src/test/ui/pattern/usefulness/match-vec-fixed.rs diff --git a/src/test/ui/match/match-vec-fixed.stderr b/src/test/ui/pattern/usefulness/match-vec-fixed.stderr similarity index 100% rename from src/test/ui/match/match-vec-fixed.stderr rename to src/test/ui/pattern/usefulness/match-vec-fixed.stderr diff --git a/src/test/ui/match/match-vec-unreachable.rs b/src/test/ui/pattern/usefulness/match-vec-unreachable.rs similarity index 100% rename from src/test/ui/match/match-vec-unreachable.rs rename to src/test/ui/pattern/usefulness/match-vec-unreachable.rs diff --git a/src/test/ui/match/match-vec-unreachable.stderr b/src/test/ui/pattern/usefulness/match-vec-unreachable.stderr similarity index 100% rename from src/test/ui/match/match-vec-unreachable.stderr rename to src/test/ui/pattern/usefulness/match-vec-unreachable.stderr diff --git a/src/test/ui/binding/nested-exhaustive-match.rs b/src/test/ui/pattern/usefulness/nested-exhaustive-match.rs similarity index 100% rename from src/test/ui/binding/nested-exhaustive-match.rs rename to src/test/ui/pattern/usefulness/nested-exhaustive-match.rs diff --git a/src/test/ui/match/non-exhaustive-defined-here.rs b/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.rs similarity index 100% rename from src/test/ui/match/non-exhaustive-defined-here.rs rename to src/test/ui/pattern/usefulness/non-exhaustive-defined-here.rs diff --git a/src/test/ui/match/non-exhaustive-defined-here.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr similarity index 100% rename from src/test/ui/match/non-exhaustive-defined-here.stderr rename to src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr diff --git a/src/test/ui/non-exhaustive/non-exhaustive-float-range-match.rs b/src/test/ui/pattern/usefulness/non-exhaustive-float-range-match.rs similarity index 100% rename from src/test/ui/non-exhaustive/non-exhaustive-float-range-match.rs rename to src/test/ui/pattern/usefulness/non-exhaustive-float-range-match.rs diff --git a/src/test/ui/non-exhaustive/non-exhaustive-float-range-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-float-range-match.stderr similarity index 100% rename from src/test/ui/non-exhaustive/non-exhaustive-float-range-match.stderr rename to src/test/ui/pattern/usefulness/non-exhaustive-float-range-match.stderr diff --git a/src/test/ui/non-exhaustive/non-exhaustive-match-nested.rs b/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.rs similarity index 100% rename from src/test/ui/non-exhaustive/non-exhaustive-match-nested.rs rename to src/test/ui/pattern/usefulness/non-exhaustive-match-nested.rs diff --git a/src/test/ui/non-exhaustive/non-exhaustive-match-nested.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr similarity index 100% rename from src/test/ui/non-exhaustive/non-exhaustive-match-nested.stderr rename to src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr diff --git a/src/test/ui/non-exhaustive/non-exhaustive-match.rs b/src/test/ui/pattern/usefulness/non-exhaustive-match.rs similarity index 100% rename from src/test/ui/non-exhaustive/non-exhaustive-match.rs rename to src/test/ui/pattern/usefulness/non-exhaustive-match.rs diff --git a/src/test/ui/non-exhaustive/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr similarity index 100% rename from src/test/ui/non-exhaustive/non-exhaustive-match.stderr rename to src/test/ui/pattern/usefulness/non-exhaustive-match.stderr diff --git a/src/test/ui/non-exhaustive/non-exhaustive-pattern-witness.rs b/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs similarity index 100% rename from src/test/ui/non-exhaustive/non-exhaustive-pattern-witness.rs rename to src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs diff --git a/src/test/ui/non-exhaustive/non-exhaustive-pattern-witness.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr similarity index 100% rename from src/test/ui/non-exhaustive/non-exhaustive-pattern-witness.stderr rename to src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr diff --git a/src/test/ui/refutable-pattern-errors.rs b/src/test/ui/pattern/usefulness/refutable-pattern-errors.rs similarity index 100% rename from src/test/ui/refutable-pattern-errors.rs rename to src/test/ui/pattern/usefulness/refutable-pattern-errors.rs diff --git a/src/test/ui/refutable-pattern-errors.stderr b/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr similarity index 100% rename from src/test/ui/refutable-pattern-errors.stderr rename to src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr diff --git a/src/test/ui/refutable-pattern-in-fn-arg.rs b/src/test/ui/pattern/usefulness/refutable-pattern-in-fn-arg.rs similarity index 100% rename from src/test/ui/refutable-pattern-in-fn-arg.rs rename to src/test/ui/pattern/usefulness/refutable-pattern-in-fn-arg.rs diff --git a/src/test/ui/refutable-pattern-in-fn-arg.stderr b/src/test/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr similarity index 100% rename from src/test/ui/refutable-pattern-in-fn-arg.stderr rename to src/test/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr diff --git a/src/test/ui/structs/struct-like-enum-nonexhaustive.rs b/src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs similarity index 100% rename from src/test/ui/structs/struct-like-enum-nonexhaustive.rs rename to src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs diff --git a/src/test/ui/structs/struct-like-enum-nonexhaustive.stderr b/src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr similarity index 100% rename from src/test/ui/structs/struct-like-enum-nonexhaustive.stderr rename to src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr diff --git a/src/test/ui/structs/struct-pattern-match-useless.rs b/src/test/ui/pattern/usefulness/struct-pattern-match-useless.rs similarity index 100% rename from src/test/ui/structs/struct-pattern-match-useless.rs rename to src/test/ui/pattern/usefulness/struct-pattern-match-useless.rs diff --git a/src/test/ui/structs/struct-pattern-match-useless.stderr b/src/test/ui/pattern/usefulness/struct-pattern-match-useless.stderr similarity index 100% rename from src/test/ui/structs/struct-pattern-match-useless.stderr rename to src/test/ui/pattern/usefulness/struct-pattern-match-useless.stderr diff --git a/src/test/ui/tuple/tuple-struct-nonexhaustive.rs b/src/test/ui/pattern/usefulness/tuple-struct-nonexhaustive.rs similarity index 100% rename from src/test/ui/tuple/tuple-struct-nonexhaustive.rs rename to src/test/ui/pattern/usefulness/tuple-struct-nonexhaustive.rs diff --git a/src/test/ui/tuple/tuple-struct-nonexhaustive.stderr b/src/test/ui/pattern/usefulness/tuple-struct-nonexhaustive.stderr similarity index 100% rename from src/test/ui/tuple/tuple-struct-nonexhaustive.stderr rename to src/test/ui/pattern/usefulness/tuple-struct-nonexhaustive.stderr