@@ -652,8 +652,7 @@ impl<'tcx> LateLintPass<'tcx> for Matches {
652652 if_chain ! {
653653 if !in_external_macro( cx. sess( ) , pat. span) ;
654654 if !in_macro( pat. span) ;
655- if let PatKind :: Struct ( ref qpath, fields, true ) = pat. kind;
656- if let QPath :: Resolved ( _, ref path) = qpath;
655+ if let PatKind :: Struct ( QPath :: Resolved ( _, ref path) , fields, true ) = pat. kind;
657656 if let Some ( def_id) = path. res. opt_def_id( ) ;
658657 let ty = cx. tcx. type_of( def_id) ;
659658 if let ty:: Adt ( def, _) = ty. kind( ) ;
@@ -962,16 +961,14 @@ fn check_wild_enum_match(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>])
962961 if let QPath :: Resolved ( _, p) = path {
963962 missing_variants. retain ( |e| e. ctor_def_id != Some ( p. res . def_id ( ) ) ) ;
964963 }
965- } else if let PatKind :: TupleStruct ( ref path, ref patterns, ..) = arm. pat . kind {
966- if let QPath :: Resolved ( _, p) = path {
967- // Some simple checks for exhaustive patterns.
968- // There is a room for improvements to detect more cases,
969- // but it can be more expensive to do so.
970- let is_pattern_exhaustive =
971- |pat : & & Pat < ' _ > | matches ! ( pat. kind, PatKind :: Wild | PatKind :: Binding ( .., None ) ) ;
972- if patterns. iter ( ) . all ( is_pattern_exhaustive) {
973- missing_variants. retain ( |e| e. ctor_def_id != Some ( p. res . def_id ( ) ) ) ;
974- }
964+ } else if let PatKind :: TupleStruct ( QPath :: Resolved ( _, p) , ref patterns, ..) = arm. pat . kind {
965+ // Some simple checks for exhaustive patterns.
966+ // There is a room for improvements to detect more cases,
967+ // but it can be more expensive to do so.
968+ let is_pattern_exhaustive =
969+ |pat : & & Pat < ' _ > | matches ! ( pat. kind, PatKind :: Wild | PatKind :: Binding ( .., None ) ) ;
970+ if patterns. iter ( ) . all ( is_pattern_exhaustive) {
971+ missing_variants. retain ( |e| e. ctor_def_id != Some ( p. res . def_id ( ) ) ) ;
975972 }
976973 }
977974 }
@@ -1446,8 +1443,7 @@ fn is_ref_some_arm(arm: &Arm<'_>) -> Option<BindingAnnotation> {
14461443 if let ExprKind :: Call ( ref e, ref args) = remove_blocks( & arm. body) . kind;
14471444 if let ExprKind :: Path ( ref some_path) = e. kind;
14481445 if match_qpath( some_path, & paths:: OPTION_SOME ) && args. len( ) == 1 ;
1449- if let ExprKind :: Path ( ref qpath) = args[ 0 ] . kind;
1450- if let & QPath :: Resolved ( _, ref path2) = qpath;
1446+ if let ExprKind :: Path ( QPath :: Resolved ( _, ref path2) ) = args[ 0 ] . kind;
14511447 if path2. segments. len( ) == 1 && ident. name == path2. segments[ 0 ] . ident. name;
14521448 then {
14531449 return Some ( rb)
0 commit comments