diff options
| author | Oli Scherer <github35764891676564198441@oli-obk.de> | 2021-03-30 16:08:53 +0000 |
|---|---|---|
| committer | Oli Scherer <github35764891676564198441@oli-obk.de> | 2021-03-31 10:40:45 +0000 |
| commit | 4e8edfb5c2a995a13cb15ee7a0e7e3bbdd3e8574 (patch) | |
| tree | c772248b425c96eac8d96e1bcb90a024bc80badd | |
| parent | dbacfbc3681622d634233bcf36504ec898f91818 (diff) | |
| download | rust-4e8edfb5c2a995a13cb15ee7a0e7e3bbdd3e8574.tar.gz rust-4e8edfb5c2a995a13cb15ee7a0e7e3bbdd3e8574.zip | |
Forward some layouts to prevent recomputation
| -rw-r--r-- | compiler/rustc_mir/src/interpret/intrinsics.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir/src/interpret/operand.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_mir/src/interpret/intrinsics.rs b/compiler/rustc_mir/src/interpret/intrinsics.rs index 9804421c1fc..d74ef66a4b2 100644 --- a/compiler/rustc_mir/src/interpret/intrinsics.rs +++ b/compiler/rustc_mir/src/interpret/intrinsics.rs @@ -171,7 +171,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { }; let val = self.tcx.const_eval_global_id(self.param_env, gid, Some(self.tcx.span))?; - let val = self.const_val_to_op(val, ty, None)?; + let val = self.const_val_to_op(val, ty, Some(dest.layout))?; self.copy_op(&val, dest)?; } diff --git a/compiler/rustc_mir/src/interpret/operand.rs b/compiler/rustc_mir/src/interpret/operand.rs index c70b57e631a..c987028f13e 100644 --- a/compiler/rustc_mir/src/interpret/operand.rs +++ b/compiler/rustc_mir/src/interpret/operand.rs @@ -578,7 +578,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { ) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>> { match val { mir::ConstantKind::Ty(ct) => self.const_to_op(ct, layout), - mir::ConstantKind::Val(val, ty) => self.const_val_to_op(*val, ty, None), + mir::ConstantKind::Val(val, ty) => self.const_val_to_op(*val, ty, layout), } } |
