rustc_mir: always emit StorageLive even without a matching StorageDead.
This commit is contained in:
parent
dc563efd98
commit
02ec0ae066
2 changed files with 5 additions and 5 deletions
|
@ -97,12 +97,12 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
|
|||
ExprKind::Box { value } => {
|
||||
let value = this.hir.mirror(value);
|
||||
let result = this.temp(expr.ty, expr_span);
|
||||
this.cfg.push(block, Statement {
|
||||
source_info,
|
||||
kind: StatementKind::StorageLive(result.clone())
|
||||
});
|
||||
if let Some(scope) = scope {
|
||||
// schedule a shallow free of that memory, lest we unwind:
|
||||
this.cfg.push(block, Statement {
|
||||
source_info,
|
||||
kind: StatementKind::StorageLive(result.clone())
|
||||
});
|
||||
this.schedule_drop(expr_span, scope, &result, value.ty);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
|
|||
let expr_ty = expr.ty.clone();
|
||||
let temp = this.temp(expr_ty.clone(), expr_span);
|
||||
|
||||
if !expr_ty.is_never() && temp_lifetime.is_some() {
|
||||
if !expr_ty.is_never() {
|
||||
this.cfg.push(block, Statement {
|
||||
source_info,
|
||||
kind: StatementKind::StorageLive(temp.clone())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue