rust/tests/ui/pattern/usefulness
Matthias Krüger 2d3dcfaade
Rollup merge of #121823 - Nadrieril:never-witnesses, r=compiler-errors
never patterns: suggest `!` patterns on non-exhaustive matches

When a match is non-exhaustive we now suggest never patterns whenever it makes sense.

r? ``@compiler-errors``
2024-03-18 22:24:36 +01:00
..
auxiliary Add note when matching on nested non-exhaustive enums 2023-08-28 14:50:32 +08:00
integer-ranges Remove MaybeInfiniteInt::JustAfterMax 2024-03-13 14:17:11 +01:00
always-inhabited-union-ref.exhaustive_patterns.stderr Unmark the feature gate as incomplete 2024-02-13 16:45:29 +01:00
always-inhabited-union-ref.min_exhaustive_patterns.stderr Unmark the feature gate as incomplete 2024-02-13 16:45:29 +01:00
always-inhabited-union-ref.rs Rollup merge of #120742 - Nadrieril:use-min_exh_pats, r=compiler-errors 2024-02-23 17:02:03 +01:00
conflicting_bindings.rs Always do all the pattern checks 2023-11-02 03:19:19 +01:00
conflicting_bindings.stderr Always do all the pattern checks 2023-11-02 03:19:19 +01:00
const-partial_eq-fallback-ice.rs remove StructuralEq trait 2024-01-24 07:56:23 +01:00
const-partial_eq-fallback-ice.stderr Do not point at #[allow(_)] as the reason for compat lint triggering 2024-02-13 20:27:43 +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 remove StructuralEq trait 2024-01-24 07:56:23 +01:00
consts-opaque.stderr update the tracking issue for structural match violations 2024-02-05 20:36:11 +01:00
deny-irrefutable-let-patterns.rs
deny-irrefutable-let-patterns.stderr Remove hir::Guard 2024-01-05 10:56:59 +00:00
doc-hidden-fields.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
doc-hidden-fields.stderr
doc-hidden-non-exhaustive.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00: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 Prefer "0..MAX not covered" to "_ not covered" 2024-02-07 23:25:11 +01:00
empty-match-check-notes.normal.stderr Prefer "0..MAX not covered" to "_ not covered" 2024-02-07 23:25:11 +01:00
empty-match-check-notes.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
empty-match.exhaustive_patterns.stderr Prefer "0..MAX not covered" to "_ not covered" 2024-02-07 23:25:11 +01:00
empty-match.normal.stderr Prefer "0..MAX not covered" to "_ not covered" 2024-02-07 23:25:11 +01:00
empty-match.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
empty-types.exhaustive_patterns.stderr Run the empty_types tests with never_patterns too 2024-03-12 21:38:30 +01:00
empty-types.min_exh_pats.stderr Run the empty_types tests with never_patterns too 2024-03-12 21:38:30 +01:00
empty-types.never_pats.stderr Don't suggest an arm when suggesting a never pattern 2024-03-12 21:38:31 +01:00
empty-types.normal.stderr Run the empty_types tests with never_patterns too 2024-03-12 21:38:30 +01:00
empty-types.rs Suggest never pattern instead of _ for empty types 2024-03-12 21:38:30 +01:00
floats.rs remove illegal_floating_point_literal_pattern lint 2024-01-26 17:25:02 +01:00
floats.stderr remove illegal_floating_point_literal_pattern lint 2024-01-26 17:25:02 +01:00
guards.rs
guards.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
impl-trait.rs Prefer min_exhaustive_patterns in tests 2024-02-13 16:45:53 +01:00
impl-trait.stderr Reveal empty opaques in depth 2023-12-23 14:59:12 +01:00
irrefutable-let-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
irrefutable-unit.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-2111.rs
issue-2111.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-3096-1.rs
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
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
issue-4321.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-12116.rs
issue-12116.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-12369.rs
issue-12369.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-13727.rs
issue-13727.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-15129.rs
issue-15129.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-30240-b.rs
issue-30240-b.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-30240-rpass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-30240.rs
issue-30240.stderr Improve clarity of diagnostic message on non-exhaustive matches 2023-09-03 19:55:11 +08:00
issue-31221.rs
issue-31221.stderr
issue-31561.rs
issue-31561.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-35609.rs
issue-35609.stderr Tweak diagnostic for consistency 2023-11-02 03:19:19 +01:00
issue-39362.rs
issue-39362.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-40221.rs
issue-40221.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-50900.rs
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
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 Stabilize THIR unsafeck 2024-01-05 10:00:59 +00: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
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
issue-78123-non-exhaustive-reference.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01: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
issue-82772-match-box-as-struct.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01: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 Add and update tests to use pattern_complexity 2024-03-03 13:10:15 +01: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
match-arm-statics-2.stderr
match-arm-statics.rs
match-arm-statics.stderr
match-byte-array-patterns-2.rs
match-byte-array-patterns-2.stderr
match-byte-array-patterns.rs
match-byte-array-patterns.stderr
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 Unmark the feature gate as incomplete 2024-02-13 16:45:29 +01:00
match-privately-empty.min_exhaustive_patterns.stderr Unmark the feature gate as incomplete 2024-02-13 16:45:29 +01:00
match-privately-empty.rs Rollup merge of #120742 - Nadrieril:use-min_exh_pats, r=compiler-errors 2024-02-23 17:02:03 +01:00
match-ref-ice.rs
match-ref-ice.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
match-slice-patterns.rs
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
match-vec-fixed.stderr
match-vec-unreachable.rs
match-vec-unreachable.stderr
nested-exhaustive-match.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00: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 Tweak spans for "adt defined here" note 2023-11-03 18:26:16 +01:00
non-exhaustive-defined-here.stderr Tweak spans for "adt defined here" note 2023-11-03 18:26:16 +01:00
non-exhaustive-match-nested.rs
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 Match usize/isize exhaustively 2023-10-27 19:56:12 +02:00
refutable-pattern-errors.stderr Match usize/isize exhaustively 2023-10-27 19:56:12 +02:00
refutable-pattern-in-fn-arg.rs Classify closure arguments in refutable pattern in argument error 2024-01-26 23:54:08 +08:00
refutable-pattern-in-fn-arg.stderr Classify closure arguments in refutable pattern in argument error 2024-01-26 23:54:08 +08:00
slice_of_empty.exhaustive_patterns.stderr Unmark the feature gate as incomplete 2024-02-13 16:45:29 +01:00
slice_of_empty.min_exhaustive_patterns.stderr Unmark the feature gate as incomplete 2024-02-13 16:45:29 +01:00
slice_of_empty.rs Rollup merge of #120742 - Nadrieril:use-min_exh_pats, r=compiler-errors 2024-02-23 17:02:03 +01:00
slice-pattern-const-2.rs
slice-pattern-const-2.stderr
slice-pattern-const-3.rs
slice-pattern-const-3.stderr
slice-pattern-const.rs
slice-pattern-const.stderr
slice-patterns-exhaustiveness.rs Keep rows with guards in the matrix 2023-11-22 03:25:15 +01:00
slice-patterns-exhaustiveness.stderr Keep rows with guards in the matrix 2023-11-22 03:25:15 +01: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
slice-patterns-reachability.stderr
stable-gated-fields.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
stable-gated-fields.stderr
stable-gated-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00: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
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
struct-pattern-match-useless.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
top-level-alternation.rs
top-level-alternation.stderr
tuple-struct-nonexhaustive.rs
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
type_polymorphic_byte_str_literals.stderr
uninhabited.rs Rollup merge of #120742 - Nadrieril:use-min_exh_pats, r=compiler-errors 2024-02-23 17:02:03 +01:00
unstable-gated-fields.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unstable-gated-fields.stderr
unstable-gated-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unstable-gated-patterns.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00