File tree Expand file tree Collapse file tree
tests/ui-fulldeps/internal-lints Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ fn foo(f: Foo) {
4646
4747 let Foo :: A { .. } = f else { loop { } } ;
4848 //~^ ERROR match is not exhaustive
49+
50+ matches ! ( f, Foo :: A { .. } ) ;
51+ //~^ ERROR match is not exhaustive
4952}
5053
5154fn main ( ) { }
Original file line number Diff line number Diff line change @@ -83,5 +83,21 @@ note: using `let else` only matches on one variant (try using `match`)
8383LL | let Foo::A { .. } = f else { loop {} };
8484 | ^^^^^^^^^^^^^
8585
86- error: aborting due to 5 previous errors
86+ error: match is not exhaustive
87+ --> $DIR/must_match_exhaustively.rs:50:14
88+ |
89+ LL | #[rustc_must_match_exhaustively]
90+ | -------------------------------- required because of this attribute
91+ ...
92+ LL | matches!(f, Foo::A { .. });
93+ | ^
94+ |
95+ = help: explicitly list all variants of the enum in a `match`
96+ note: because of this wildcard pattern
97+ --> $DIR/must_match_exhaustively.rs:50:5
98+ |
99+ LL | matches!(f, Foo::A { .. });
100+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
101+
102+ error: aborting due to 6 previous errors
87103
You can’t perform that action at this time.
0 commit comments