This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
compiler/rustc_hir_analysis/src/check Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -689,6 +689,8 @@ fn resolve_local<'tcx>(
689689 /// | [ ..., E&, ... ]
690690 /// | ( ..., E&, ... )
691691 /// | {...; E&}
692+ /// | if _ { ...; E& } else { ...; E& }
693+ /// | match _ { ..., _ => E&, ... }
692694 /// | box E&
693695 /// | E& as ...
694696 /// | ( E& )
@@ -727,6 +729,17 @@ fn resolve_local<'tcx>(
727729 record_rvalue_scope_if_borrow_expr ( visitor, subexpr, blk_id) ;
728730 }
729731 }
732+ hir:: ExprKind :: If ( _, then_block, else_block) => {
733+ record_rvalue_scope_if_borrow_expr ( visitor, then_block, blk_id) ;
734+ if let Some ( else_block) = else_block {
735+ record_rvalue_scope_if_borrow_expr ( visitor, else_block, blk_id) ;
736+ }
737+ }
738+ hir:: ExprKind :: Match ( _, arms, _) => {
739+ for arm in arms {
740+ record_rvalue_scope_if_borrow_expr ( visitor, arm. body , blk_id) ;
741+ }
742+ }
730743 hir:: ExprKind :: Call ( ..) | hir:: ExprKind :: MethodCall ( ..) => {
731744 // FIXME(@dingxiangfei2009): choose call arguments here
732745 // for candidacy for extended parameter rule application
You can’t perform that action at this time.
0 commit comments