Skip to content

Commit 4165c89

Browse files
committed
Can't use layout_of_local for the frame currently being created
1 parent 154c54c commit 4165c89

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_mir/interpret/eval_context.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,10 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
509509
for (idx, local) in locals.iter_enumerated_mut() {
510510
match local.state {
511511
LocalState::Live(_) => {
512-
// This needs to be peoperly initialized.
513-
let layout = self.layout_of_local(self.frame(), idx, None)?;
512+
// This needs to be properly initialized.
513+
let layout = self.layout_of(mir.local_decls[idx].ty)?;
514514
local.state = LocalState::Live(self.uninit_operand(layout)?);
515+
local.layout = Cell::new(Some(layout));
515516
}
516517
LocalState::Dead => {
517518
// Nothing to do

0 commit comments

Comments
 (0)