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>(
499
499
}
500
500
501
501
// 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) => {
503
503
// Compute the most demanding borrow from all the arms'
504
504
// 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 ) ) {
510
506
v. mut_rvalue_borrows . insert ( expr. hir_id ) ;
511
507
}
512
508
513
509
let _ = v. check_expr ( expr) ;
514
- for index in hirvec_arm . iter ( ) {
510
+ for index in arms . iter ( ) {
515
511
let _ = v. check_expr ( & * index. body ) ;
516
512
if let Some ( hir:: Guard :: If ( ref expr) ) = index. guard {
517
513
let _ = v. check_expr ( & expr) ;
You can’t perform that action at this time.
0 commit comments