@@ -1110,27 +1110,26 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1110
1110
}
1111
1111
}
1112
1112
1113
- // Returns whether the given expression is a destruct assignment desugaring.
1114
- // For example, `(a, b) = (1, &2);`
1115
- // Here we try to find the pattern binding of the expression,
1116
- // `default_binding_modes` is false only for destruct assignment desugaring.
1113
+ /// Returns whether the given expression is a destruct assignment desugaring.
1114
+ /// For example, `(a, b) = (1, &2);`
1115
+ /// Here we try to find the pattern binding of the expression,
1116
+ /// `default_binding_modes` is false only for destruct assignment desugaring.
1117
1117
pub ( crate ) fn is_destruct_assignment_desugaring ( & self , expr : & hir:: Expr < ' _ > ) -> bool {
1118
1118
if let hir:: ExprKind :: Path ( hir:: QPath :: Resolved (
1119
1119
_,
1120
1120
hir:: Path { res : hir:: def:: Res :: Local ( bind_hir_id) , .. } ,
1121
1121
) ) = expr. kind
1122
- {
1123
- let bind = self . tcx . hir_node ( * bind_hir_id) ;
1124
- let parent = self . tcx . parent_hir_node ( * bind_hir_id) ;
1125
- if let hir:: Node :: Pat ( hir:: Pat {
1122
+ && let bind = self . tcx . hir_node ( * bind_hir_id)
1123
+ && let parent = self . tcx . parent_hir_node ( * bind_hir_id)
1124
+ && let hir:: Node :: Pat ( hir:: Pat {
1126
1125
kind : hir:: PatKind :: Binding ( _, _hir_id, _, _) , ..
1127
1126
} ) = bind
1128
- && let hir:: Node :: Pat ( hir:: Pat { default_binding_modes : false , .. } ) = parent
1129
- {
1130
- return true ;
1131
- }
1127
+ && let hir:: Node :: Pat ( hir:: Pat { default_binding_modes : false , .. } ) = parent
1128
+ {
1129
+ true
1130
+ } else {
1131
+ false
1132
1132
}
1133
- false
1134
1133
}
1135
1134
1136
1135
fn explain_self_literal (
0 commit comments