mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 05:26:47 +00:00
Propagate temporary lifetime extension into if and match.
This commit is contained in:
parent
cce6a6e22e
commit
679b90c295
@ -689,6 +689,8 @@ fn resolve_local<'tcx>(
|
||||
/// | [ ..., E&, ... ]
|
||||
/// | ( ..., E&, ... )
|
||||
/// | {...; E&}
|
||||
/// | if _ { ...; E& } else { ...; E& }
|
||||
/// | match _ { ..., _ => E&, ... }
|
||||
/// | box E&
|
||||
/// | E& as ...
|
||||
/// | ( E& )
|
||||
@ -727,6 +729,17 @@ fn resolve_local<'tcx>(
|
||||
record_rvalue_scope_if_borrow_expr(visitor, subexpr, blk_id);
|
||||
}
|
||||
}
|
||||
hir::ExprKind::If(_, then_block, else_block) => {
|
||||
record_rvalue_scope_if_borrow_expr(visitor, then_block, blk_id);
|
||||
if let Some(else_block) = else_block {
|
||||
record_rvalue_scope_if_borrow_expr(visitor, else_block, blk_id);
|
||||
}
|
||||
}
|
||||
hir::ExprKind::Match(_, arms, _) => {
|
||||
for arm in arms {
|
||||
record_rvalue_scope_if_borrow_expr(visitor, arm.body, blk_id);
|
||||
}
|
||||
}
|
||||
hir::ExprKind::Call(..) | hir::ExprKind::MethodCall(..) => {
|
||||
// FIXME(@dingxiangfei2009): choose call arguments here
|
||||
// for candidacy for extended parameter rule application
|
||||
|
Loading…
Reference in New Issue
Block a user