rust/tests/ui/pattern/usefulness
Chayim Refael Friedman 6bf3cbe39e In rustc_pattern_analysis, put true witnesses before false witnesses
In rustc it doesn't really matter what the order of the witnesses is, but I'm planning to use the witnesses for implementing the "add missing match arms" assist in rust-analyzer, and there `true` before `false` is the natural order (like `Some` before `None`), and also what the current assist does.

The current order doesn't seem to be intentional; the code was created when bool ctors became their own thing, not just int ctors, but for integer, 0 before 1 is indeed the natural order.
2025-07-28 02:01:39 +03:00
..
auxiliary Add note when matching on nested non-exhaustive enums 2023-08-28 14:50:32 +08:00
integer-ranges Trim suggestion part before generating highlights 2025-02-21 00:54:01 +00:00
always-inhabited-union-ref.exhaustive_patterns.stderr Update tests 2024-08-10 12:07:17 +02:00
always-inhabited-union-ref.normal.stderr Update tests 2024-08-10 12:07:17 +02:00
always-inhabited-union-ref.rs Update tests 2024-08-10 12:07:17 +02:00
conflicting_bindings.rs Remove let_chains feature 2025-06-30 07:49:20 -05:00
conflicting_bindings.stderr Remove let_chains feature 2025-06-30 07:49:20 -05:00
const-partial_eq-fallback-ice.rs Add additional context for non-sructural type constant used in pattern 2024-12-04 20:29:36 +00:00
const-partial_eq-fallback-ice.stderr Add additional context for non-sructural type constant used in pattern 2024-12-04 20:29:36 +00:00
const-pat-ice.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-private-fields.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
consts-opaque.rs turn pointer_structural_match into a hard error 2024-05-03 15:56:59 +02:00
consts-opaque.stderr Tweak ptr in pattern error 2024-12-04 20:29:36 +00:00
deny-irrefutable-let-patterns.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
deny-irrefutable-let-patterns.stderr Remove hir::Guard 2024-01-05 10:56:59 +00:00
doc-hidden-fields.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
doc-hidden-fields.stderr Trim suggestion parts to the subset that is purely additive 2025-02-14 00:44:10 -08:00
doc-hidden-non-exhaustive.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
doc-hidden-non-exhaustive.stderr Tweak spans for "adt defined here" note 2023-11-03 18:26:16 +01:00
empty-match-check-notes.exhaustive_patterns.stderr Update tests for new TRPL chapter order 2024-11-23 08:57:25 -07:00
empty-match-check-notes.normal.stderr Update tests for new TRPL chapter order 2024-11-23 08:57:25 -07:00
empty-match-check-notes.rs Add a note with a link to explain empty types 2024-08-19 21:57:37 +02:00
empty-match.exhaustive_patterns.stderr Test that 0/unknown-length arrays are nonempty 2024-08-10 12:07:17 +02:00
empty-match.normal.stderr Test that 0/unknown-length arrays are nonempty 2024-08-10 12:07:17 +02:00
empty-match.rs Test that 0/unknown-length arrays are nonempty 2024-08-10 12:07:17 +02:00
empty-types.exhaustive_patterns.stderr Trim suggestion part before generating highlights 2025-02-21 00:54:01 +00:00
empty-types.never_pats.stderr Trim suggestion part before generating highlights 2025-02-21 00:54:01 +00:00
empty-types.normal.stderr Trim suggestion part before generating highlights 2025-02-21 00:54:01 +00:00
empty-types.rs Revert warning empty patterns as unreachable 2024-09-11 18:36:45 +02:00
explain-unreachable-pats.rs Revert warning empty patterns as unreachable 2024-09-11 18:36:45 +02:00
explain-unreachable-pats.stderr Add a machine-applicable suggestion to "unreachable pattern" 2024-09-13 21:01:29 +02:00
floats.rs Replace f16 and f128 pattern matching stubs with real implementations 2024-06-23 04:28:42 -05:00
floats.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
guards.rs Stabilize exclusive_range 2024-05-02 19:42:31 -04:00
guards.stderr Stabilize exclusive_range 2024-05-02 19:42:31 -04:00
impl-trait.rs Implement #[define_opaque] attribute for functions. 2025-03-11 12:05:02 +00:00
impl-trait.stderr Implement #[define_opaque] attribute for functions. 2025-03-11 12:05:02 +00:00
irrefutable-let-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
irrefutable-unit.rs tests: remove //@ pretty-expanded usages 2024-11-26 02:50:48 +08:00
issue-2111.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-2111.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-3096-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-3096-1.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-3096-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-3096-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-3601.rs Keep rows with guards in the matrix 2023-11-22 03:25:15 +01:00
issue-3601.stderr Auto merge of #117611 - Nadrieril:linear-pass-take-4, r=cjgillot 2023-11-26 00:14:14 +00:00
issue-4321.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-4321.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-12116.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-12116.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
issue-12369.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-12369.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
issue-13727.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-13727.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
issue-15129.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-15129.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-30240-b.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-30240-b.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
issue-30240-rpass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-30240.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-30240.stderr Improve clarity of diagnostic message on non-exhaustive matches 2023-09-03 19:55:11 +08:00
issue-31221.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-31221.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
issue-31561.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-31561.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-35609.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-35609.stderr Tweak diagnostic for consistency 2023-11-02 03:19:19 +01:00
issue-39362.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-39362.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-40221.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-40221.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-50900.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-50900.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-53820-slice-pattern-large-array.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-56379.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-56379.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-57472.rs Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
issue-57472.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
issue-65413-constants-and-slices-exhaustiveness.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-66501.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-71930-type-of-match-scrutinee.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-72377.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-72377.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-72476-and-89393-associated-type.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-78123-non-exhaustive-reference.rs compiletest: Do not require annotations on empty labels and suggestions 2025-05-03 22:49:23 +03:00
issue-78123-non-exhaustive-reference.stderr compiletest: Do not require annotations on empty labels and suggestions 2025-05-03 22:49:23 +03:00
issue-78549-ref-pat-and-str.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-80501-or-pat-and-macro.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-82772-match-box-as-struct.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-82772-match-box-as-struct.stderr Emit a single privacy error for multiple fields on the same struct expression 2025-01-18 20:33:15 +00:00
issue-85222-types-containing-non-exhaustive-types.rs Match usize/isize exhaustively 2023-10-27 19:56:12 +02:00
issue-85222-types-containing-non-exhaustive-types.stderr Remove the precise_pointer_size_matching feature gate 2023-12-04 11:56:21 +01:00
issue-88747.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-105479-str-non-exhaustiveness.rs Improve clarity of diagnostic message on non-exhaustive matches 2023-09-03 19:55:11 +08:00
issue-105479-str-non-exhaustiveness.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-118437-exponential-time-on-diagonal-match.rs Rename pattern_complexity attr as pattern_complexity_limit. 2025-02-17 09:30:40 +11:00
issue-119493-type-error-ice.rs Abort analysis on type error 2024-01-07 22:13:08 +01:00
issue-119493-type-error-ice.stderr Bless tests 2024-01-13 12:46:58 -05:00
issue-119778-type-error-ice.rs Add test case for #119778 2024-01-10 14:50:48 +01:00
issue-119778-type-error-ice.stderr Bless tests 2024-01-13 12:46:58 -05:00
match-arm-statics-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-arm-statics-2.stderr Unify expanded constants and named constants in PatKind 2024-11-17 23:40:00 +00:00
match-arm-statics.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-arm-statics.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
match-byte-array-patterns-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-byte-array-patterns-2.stderr Perform match checking on THIR. 2023-04-03 15:59:21 +00:00
match-byte-array-patterns.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-byte-array-patterns.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
match-non-exhaustive.rs add note for non-exhaustive matches with guards 2023-06-28 01:51:53 -04:00
match-non-exhaustive.stderr Keep rows with guards in the matrix 2023-11-22 03:25:15 +01:00
match-privately-empty.exhaustive_patterns.stderr Update tests 2024-08-10 12:07:17 +02:00
match-privately-empty.normal.stderr Update tests 2024-08-10 12:07:17 +02:00
match-privately-empty.rs Update tests 2024-08-10 12:07:17 +02:00
match-ref-ice.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-ref-ice.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
match-slice-patterns.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-slice-patterns.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
match-vec-fixed.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-vec-fixed.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
match-vec-unreachable.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-vec-unreachable.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
nested-exhaustive-match.rs tests: remove //@ pretty-expanded usages 2024-11-26 02:50:48 +08:00
nested-non-exhaustive-enums.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
nested-non-exhaustive-enums.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
non-exhaustive-defined-here.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
non-exhaustive-defined-here.stderr Update tests for new TRPL chapter order 2024-11-23 08:57:25 -07:00
non-exhaustive-match-nested.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
non-exhaustive-match-nested.stderr Tweak spans for "adt defined here" note 2023-11-03 18:26:16 +01:00
non-exhaustive-match.rs remove illegal_floating_point_literal_pattern lint 2024-01-26 17:25:02 +01:00
non-exhaustive-match.stderr remove illegal_floating_point_literal_pattern lint 2024-01-26 17:25:02 +01:00
non-exhaustive-pattern-witness.rs Match usize/isize exhaustively 2023-10-27 19:56:12 +02:00
non-exhaustive-pattern-witness.stderr Tweak spans for "adt defined here" note 2023-11-03 18:26:16 +01:00
refutable-pattern-errors.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
refutable-pattern-errors.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
refutable-pattern-in-fn-arg.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
refutable-pattern-in-fn-arg.stderr Classify closure arguments in refutable pattern in argument error 2024-01-26 23:54:08 +08:00
rustfix-unreachable-pattern.fixed Add a machine-applicable suggestion to "unreachable pattern" 2024-09-13 21:01:29 +02:00
rustfix-unreachable-pattern.rs Add a machine-applicable suggestion to "unreachable pattern" 2024-09-13 21:01:29 +02:00
rustfix-unreachable-pattern.stderr Add a machine-applicable suggestion to "unreachable pattern" 2024-09-13 21:01:29 +02:00
slice-pattern-const-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
slice-pattern-const-2.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
slice-pattern-const-3.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
slice-pattern-const-3.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
slice-pattern-const.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
slice-pattern-const.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
slice-patterns-exhaustiveness.rs Keep rows with guards in the matrix 2023-11-22 03:25:15 +01:00
slice-patterns-exhaustiveness.stderr Unify expanded constants and named constants in PatKind 2024-11-17 23:40:00 +00:00
slice-patterns-irrefutable.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
slice-patterns-reachability.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
slice-patterns-reachability.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
slice_of_empty.exhaustive_patterns.stderr Update tests 2024-08-10 12:07:17 +02:00
slice_of_empty.normal.stderr Update tests 2024-08-10 12:07:17 +02:00
slice_of_empty.rs Update tests 2024-08-10 12:07:17 +02:00
stable-gated-fields.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
stable-gated-fields.stderr Trim suggestion parts to the subset that is purely additive 2025-02-14 00:44:10 -08:00
stable-gated-patterns.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
stable-gated-patterns.stderr Tweak spans for "adt defined here" note 2023-11-03 18:26:16 +01:00
struct-like-enum-nonexhaustive.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
struct-like-enum-nonexhaustive.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
struct-pattern-match-useless.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
struct-pattern-match-useless.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
top-level-alternation.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
top-level-alternation.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
tuple-struct-nonexhaustive.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
tuple-struct-nonexhaustive.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type_polymorphic_byte_str_literals.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type_polymorphic_byte_str_literals.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
uninhabited.rs Use non-2015 edition paths in tests that do not test for their resolution 2025-06-03 13:35:31 +02:00
unions.rs In rustc_pattern_analysis, put true witnesses before false witnesses 2025-07-28 02:01:39 +03:00
unions.stderr In rustc_pattern_analysis, put true witnesses before false witnesses 2025-07-28 02:01:39 +03:00
unstable-gated-fields.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
unstable-gated-fields.stderr More sophisticated span trimming 2025-02-21 00:41:17 +00:00
unstable-gated-patterns.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
unstable-gated-patterns.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00