diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-08-04 12:46:07 +0200 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-08-04 13:43:17 +0200 |
| commit | 181bb30d078dd2cff4f92c09026aa8ccbac768bf (patch) | |
| tree | 84e03c110985a54fad7c9f1a45cce6e165e0d14e /src | |
| parent | 726b027ba3d2658d1a7796f46ea404c7299b7c0c (diff) | |
| download | rust-181bb30d078dd2cff4f92c09026aa8ccbac768bf.tar.gz rust-181bb30d078dd2cff4f92c09026aa8ccbac768bf.zip | |
Rustc reorders fields, but miri expects them in source order
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/interpret/eval_context.rs | 4 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/step.rs | 4 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/terminator/mod.rs | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index 9f37b3521dc..e25fb145e75 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -690,7 +690,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> { } } - StructWrappedNullablePointer { nndiscr, ref discrfield, .. } => { + StructWrappedNullablePointer { nndiscr, ref discrfield_source, .. } => { if let mir::AggregateKind::Adt(_, variant, _, _) = **kind { if nndiscr == variant as u64 { self.assign_fields(dest, dest_ty, operands)?; @@ -699,7 +699,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> { let operand_ty = self.operand_ty(operand); assert_eq!(self.type_size(operand_ty)?, Some(0)); } - let (offset, TyAndPacked { ty, packed: _}) = self.nonnull_offset_and_ty(dest_ty, nndiscr, discrfield)?; + let (offset, TyAndPacked { ty, packed: _}) = self.nonnull_offset_and_ty(dest_ty, nndiscr, discrfield_source)?; // TODO: The packed flag is ignored // FIXME(solson) diff --git a/src/librustc_mir/interpret/step.rs b/src/librustc_mir/interpret/step.rs index 7ad51a08a46..6ecaba5ccb8 100644 --- a/src/librustc_mir/interpret/step.rs +++ b/src/librustc_mir/interpret/step.rs @@ -104,9 +104,9 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> { } } - Layout::StructWrappedNullablePointer { nndiscr, ref discrfield, .. } => { + Layout::StructWrappedNullablePointer { nndiscr, ref discrfield_source, .. } => { if variant_index as u64 != nndiscr { - let (offset, TyAndPacked { ty, packed }) = self.nonnull_offset_and_ty(dest_ty, nndiscr, discrfield)?; + let (offset, TyAndPacked { ty, packed }) = self.nonnull_offset_and_ty(dest_ty, nndiscr, discrfield_source)?; let nonnull = self.force_allocation(dest)?.to_ptr()?.offset(offset.bytes(), &self)?; trace!("struct wrapped nullable pointer type: {}", ty); // only the pointer part of a fat pointer is used for this space optimization diff --git a/src/librustc_mir/interpret/terminator/mod.rs b/src/librustc_mir/interpret/terminator/mod.rs index ce04e1b8d1e..b9447a30ab1 100644 --- a/src/librustc_mir/interpret/terminator/mod.rs +++ b/src/librustc_mir/interpret/terminator/mod.rs @@ -440,8 +440,8 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> { self.read_nonnull_discriminant_value(adt_ptr, nndiscr as u128, discr_size)? } - StructWrappedNullablePointer { nndiscr, ref discrfield, .. } => { - let (offset, TyAndPacked { ty, packed }) = self.nonnull_offset_and_ty(adt_ty, nndiscr, discrfield)?; + StructWrappedNullablePointer { nndiscr, ref discrfield_source, .. } => { + let (offset, TyAndPacked { ty, packed }) = self.nonnull_offset_and_ty(adt_ty, nndiscr, discrfield_source)?; let nonnull = adt_ptr.offset(offset.bytes(), &*self)?; trace!("struct wrapped nullable pointer type: {}", ty); // only the pointer part of a fat pointer is used for this space optimization |
