@@ -652,8 +652,7 @@ impl<'tcx> LateLintPass<'tcx> for Matches {
652
652
if_chain ! {
653
653
if !in_external_macro( cx. sess( ) , pat. span) ;
654
654
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;
657
656
if let Some ( def_id) = path. res. opt_def_id( ) ;
658
657
let ty = cx. tcx. type_of( def_id) ;
659
658
if let ty:: Adt ( def, _) = ty. kind( ) ;
@@ -962,16 +961,14 @@ fn check_wild_enum_match(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>])
962
961
if let QPath :: Resolved ( _, p) = path {
963
962
missing_variants. retain ( |e| e. ctor_def_id != Some ( p. res . def_id ( ) ) ) ;
964
963
}
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 ( ) ) ) ;
975
972
}
976
973
}
977
974
}
@@ -1446,8 +1443,7 @@ fn is_ref_some_arm(arm: &Arm<'_>) -> Option<BindingAnnotation> {
1446
1443
if let ExprKind :: Call ( ref e, ref args) = remove_blocks( & arm. body) . kind;
1447
1444
if let ExprKind :: Path ( ref some_path) = e. kind;
1448
1445
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;
1451
1447
if path2. segments. len( ) == 1 && ident. name == path2. segments[ 0 ] . ident. name;
1452
1448
then {
1453
1449
return Some ( rb)
0 commit comments