@@ -150,6 +150,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'_>]) {
150
150
#[ derive( Clone , Copy ) ]
151
151
enum NormalizedPat < ' a > {
152
152
Wild ,
153
+ Never ,
153
154
Struct ( Option < DefId > , & ' a [ ( Symbol , Self ) ] ) ,
154
155
Tuple ( Option < DefId > , & ' a [ Self ] ) ,
155
156
Or ( & ' a [ Self ] ) ,
@@ -229,6 +230,7 @@ impl<'a> NormalizedPat<'a> {
229
230
PatKind :: Binding ( .., Some ( pat) ) | PatKind :: Box ( pat) | PatKind :: Ref ( pat, _) => {
230
231
Self :: from_pat ( cx, arena, pat)
231
232
} ,
233
+ PatKind :: Never => Self :: Never ,
232
234
PatKind :: Struct ( ref path, fields, _) => {
233
235
let fields =
234
236
arena. alloc_from_iter ( fields. iter ( ) . map ( |f| ( f. ident . name , Self :: from_pat ( cx, arena, f. pat ) ) ) ) ;
@@ -333,6 +335,7 @@ impl<'a> NormalizedPat<'a> {
333
335
fn has_overlapping_values ( & self , other : & Self ) -> bool {
334
336
match ( * self , * other) {
335
337
( Self :: Wild , _) | ( _, Self :: Wild ) => true ,
338
+ ( Self :: Never , Self :: Never ) => true ,
336
339
( Self :: Or ( pats) , ref other) | ( ref other, Self :: Or ( pats) ) => {
337
340
pats. iter ( ) . any ( |pat| pat. has_overlapping_values ( other) )
338
341
} ,
0 commit comments