File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -499,19 +499,15 @@ fn check_expr_kind<'a, 'tcx>(
499499 }
500500
501501 // Conditional control flow (possible to implement).
502- hir:: ExprKind :: Match ( ref expr, ref hirvec_arm , ref _match_source) => {
502+ hir:: ExprKind :: Match ( ref expr, ref arms , ref _match_source) => {
503503 // Compute the most demanding borrow from all the arms'
504504 // patterns and set that on the discriminator.
505- let mut mut_borrow = false ;
506- for pat in hirvec_arm. iter ( ) . flat_map ( |arm| arm. top_pats_hack ( ) ) {
507- mut_borrow = v. remove_mut_rvalue_borrow ( pat) ;
508- }
509- if mut_borrow {
505+ if arms. iter ( ) . fold ( false , |_, arm| v. remove_mut_rvalue_borrow ( & arm. pat ) ) {
510506 v. mut_rvalue_borrows . insert ( expr. hir_id ) ;
511507 }
512508
513509 let _ = v. check_expr ( expr) ;
514- for index in hirvec_arm . iter ( ) {
510+ for index in arms . iter ( ) {
515511 let _ = v. check_expr ( & * index. body ) ;
516512 if let Some ( hir:: Guard :: If ( ref expr) ) = index. guard {
517513 let _ = v. check_expr ( & expr) ;
You can’t perform that action at this time.
0 commit comments