@@ -150,6 +150,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'_>]) {
150150#[ derive( Clone , Copy ) ]
151151enum NormalizedPat < ' a > {
152152 Wild ,
153+ Never ,
153154 Struct ( Option < DefId > , & ' a [ ( Symbol , Self ) ] ) ,
154155 Tuple ( Option < DefId > , & ' a [ Self ] ) ,
155156 Or ( & ' a [ Self ] ) ,
@@ -229,6 +230,7 @@ impl<'a> NormalizedPat<'a> {
229230 PatKind :: Binding ( .., Some ( pat) ) | PatKind :: Box ( pat) | PatKind :: Ref ( pat, _) => {
230231 Self :: from_pat ( cx, arena, pat)
231232 } ,
233+ PatKind :: Never => Self :: Never ,
232234 PatKind :: Struct ( ref path, fields, _) => {
233235 let fields =
234236 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> {
333335 fn has_overlapping_values ( & self , other : & Self ) -> bool {
334336 match ( * self , * other) {
335337 ( Self :: Wild , _) | ( _, Self :: Wild ) => true ,
338+ ( Self :: Never , Self :: Never ) => true ,
336339 ( Self :: Or ( pats) , ref other) | ( ref other, Self :: Or ( pats) ) => {
337340 pats. iter ( ) . any ( |pat| pat. has_overlapping_values ( other) )
338341 } ,
0 commit comments