summaryrefslogtreecommitdiffstats
path: root/src/librustc_mir/interpret/step.rs
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2017-12-01 18:29:35 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2017-12-17 16:34:54 +0200
commit7c6f242ca8a4eca33e8257906cc549b6b1418be2 (patch)
treed10a97a0b718d3f278f86524db11c432134db3ec /src/librustc_mir/interpret/step.rs
parentAuto merge of #46778 - petrochenkov:nounwrap, r=arielb1 (diff)
downloadgrust-7c6f242ca8a4eca33e8257906cc549b6b1418be2.tar.gz
grust-7c6f242ca8a4eca33e8257906cc549b6b1418be2.tar.bz2
grust-7c6f242ca8a4eca33e8257906cc549b6b1418be2.tar.xz
rustc: don't track whether layouts are "packed".
Diffstat (limited to 'src/librustc_mir/interpret/step.rs')
-rw-r--r--src/librustc_mir/interpret/step.rs18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/librustc_mir/interpret/step.rs b/src/librustc_mir/interpret/step.rs
index 352e151e3a..ae382bd12c 100644
--- a/src/librustc_mir/interpret/step.rs
+++ b/src/librustc_mir/interpret/step.rs
@@ -8,7 +8,7 @@ use rustc::mir;
8use rustc::ty::{self, Instance}; 8use rustc::ty::{self, Instance};
9use rustc::ty::layout::LayoutOf; 9use rustc::ty::layout::LayoutOf;
10use rustc::middle::const_val::ConstVal; 10use rustc::middle::const_val::ConstVal;
11use rustc::mir::interpret::{PtrAndAlign, GlobalId}; 11use rustc::mir::interpret::GlobalId;
12 12
13use rustc::mir::interpret::{EvalResult, EvalErrorKind}; 13use rustc::mir::interpret::{EvalResult, EvalErrorKind};
14use super::{EvalContext, StackPopCleanup, Place, Machine}; 14use super::{EvalContext, StackPopCleanup, Place, Machine};
@@ -182,13 +182,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
182 layout.align.abi(), 182 layout.align.abi(),
183 None, 183 None,
184 )?; 184 )?;
185 self.tcx.interpret_interner.borrow_mut().cache( 185 self.tcx.interpret_interner.borrow_mut().cache(cid, ptr.into());
186 cid,
187 PtrAndAlign {
188 ptr: ptr.into(),
189 aligned: !layout.is_packed(),
190 },
191 );
192 let internally_mutable = !layout.ty.is_freeze(self.tcx, self.param_env, span); 186 let internally_mutable = !layout.ty.is_freeze(self.tcx, self.param_env, span);
193 let mutability = if mutability == Mutability::Mutable || internally_mutable { 187 let mutability = if mutability == Mutability::Mutable || internally_mutable {
194 Mutability::Mutable 188 Mutability::Mutable
@@ -273,13 +267,7 @@ impl<'a, 'b, 'tcx, M: Machine<'tcx>> Visitor<'tcx> for ConstantExtractor<'a, 'b,
273 layout.align.abi(), 267 layout.align.abi(),
274 None, 268 None,
275 )?; 269 )?;
276 this.ecx.tcx.interpret_interner.borrow_mut().cache( 270 this.ecx.tcx.interpret_interner.borrow_mut().cache(cid, ptr.into());
277 cid,
278 PtrAndAlign {
279 ptr: ptr.into(),
280 aligned: !layout.is_packed(),
281 },
282 );
283 trace!("pushing stack frame for {:?}", index); 271 trace!("pushing stack frame for {:?}", index);
284 this.ecx.push_stack_frame( 272 this.ecx.push_stack_frame(
285 this.instance, 273 this.instance,