Skip to content

Commit 335315a

Browse files
committed
Add flag in build as_rvalue
1 parent 3bdc317 commit 335315a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_mir_build/src/build/expr/as_rvalue.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
601601
let this = self;
602602

603603
let source_info = this.source_info(upvar_span);
604-
let temp = this.local_decls.push(LocalDecl::new(upvar_ty, upvar_span));
604+
let mut decl = LocalDecl::new(upvar_ty, upvar_span);
605+
decl.always_storage_live = true; // this will be StorageLive below
606+
let temp = this.local_decls.push(decl);
605607

606608
this.cfg.push(block, Statement { source_info, kind: StatementKind::StorageLive(temp) });
607609

0 commit comments

Comments
 (0)