diff options
| -rw-r--r-- | src/librustc_mir/const_eval.rs | 2 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/place.rs | 27 |
2 files changed, 2 insertions, 27 deletions
diff --git a/src/librustc_mir/const_eval.rs b/src/librustc_mir/const_eval.rs index de0f8dbcf21..8f3364b1fba 100644 --- a/src/librustc_mir/const_eval.rs +++ b/src/librustc_mir/const_eval.rs @@ -661,7 +661,7 @@ pub fn const_eval_raw_provider<'tcx>( |body| eval_body_using_ecx(&mut ecx, cid, body, key.param_env) ).and_then(|place| { Ok(RawConst { - alloc_id: place.to_ptr().expect("we allocated this ptr!").alloc_id, + alloc_id: place.ptr.assert_ptr().alloc_id, ty: place.layout.ty }) }).map_err(|error| { diff --git a/src/librustc_mir/interpret/place.rs b/src/librustc_mir/interpret/place.rs index 9641164b119..43f8677cd32 100644 --- a/src/librustc_mir/interpret/place.rs +++ b/src/librustc_mir/interpret/place.rs @@ -122,21 +122,6 @@ impl<Tag> MemPlace<Tag> { Self::from_scalar_ptr(ptr.into(), align) } - #[inline(always)] - pub fn to_scalar_ptr_align(self) -> (Scalar<Tag>, Align) { - assert!(self.meta.is_none()); - (self.ptr, self.align) - } - - /// metact the ptr part of the mplace - #[inline(always)] - pub fn to_ptr(self) -> InterpResult<'tcx, Pointer<Tag>> { - // At this point, we forget about the alignment information -- - // the place has been turned into a reference, and no matter where it came from, - // it now must be aligned. - self.to_scalar_ptr_align().0.to_ptr() - } - /// Turn a mplace into a (thin or fat) pointer, as a reference, pointing to the same space. /// This is the inverse of `ref_to_mplace`. #[inline(always)] @@ -246,7 +231,7 @@ impl<'tcx, Tag: ::std::fmt::Debug + Copy> OpTy<'tcx, Tag> { } } -impl<'tcx, Tag: ::std::fmt::Debug> Place<Tag> { +impl<Tag: ::std::fmt::Debug> Place<Tag> { /// Produces a Place that will error if attempted to be read from or written to #[inline(always)] pub fn null(cx: &impl HasDataLayout) -> Self { @@ -271,16 +256,6 @@ impl<'tcx, Tag: ::std::fmt::Debug> Place<Tag> { } } - - #[inline] - pub fn to_scalar_ptr_align(self) -> (Scalar<Tag>, Align) { - self.assert_mem_place().to_scalar_ptr_align() - } - - #[inline] - pub fn to_ptr(self) -> InterpResult<'tcx, Pointer<Tag>> { - self.assert_mem_place().to_ptr() - } } impl<'tcx, Tag: ::std::fmt::Debug> PlaceTy<'tcx, Tag> { |
