diff options
author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-01-30 15:42:00 +0100 |
---|---|---|
committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-01-30 15:42:00 +0100 |
commit | 4e0af1fee19c2ff056e20a55464c233dc30e5c92 (patch) | |
tree | 3939461fe32cf5270befc52f8e33ca88a5e949a5 | |
parent | 7017927aaf5ba14cec6c28b1079a93abfc715985 (diff) | |
download | rust-4e0af1fee19c2ff056e20a55464c233dc30e5c92.tar.gz |
Monomorphize types when not going through `layout_of_local`
-rw-r--r-- | src/librustc_mir/interpret/eval_context.rs | 3 | ||||
-rw-r--r-- | src/librustc_mir/interpret/place.rs | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index 3382288b99a..4bf84cb465f 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -510,7 +510,8 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc match local.state { LocalState::Live(_) => { // This needs to be properly initialized. - let layout = self.layout_of(mir.local_decls[idx].ty)?; + let ty = self.monomorphize(mir.local_decls[idx].ty)?; + let layout = self.layout_of(ty)?; local.state = LocalState::Live(self.uninit_operand(layout)?); local.layout = Cell::new(Some(layout)); } diff --git a/src/librustc_mir/interpret/place.rs b/src/librustc_mir/interpret/place.rs index ba1960300a8..9ca7f9d8e27 100644 --- a/src/librustc_mir/interpret/place.rs +++ b/src/librustc_mir/interpret/place.rs @@ -624,7 +624,7 @@ where // their layout on return. PlaceTy { place: *return_place, - layout: self.layout_of(self.frame().mir.return_ty())?, + layout: self.layout_of(self.monomorphize(self.frame().mir.return_ty())?)?, }, None => return err!(InvalidNullPointerUsage), }, |