Skip to content
Permalink
Browse files

remove some no-longer-needed methods

  • Loading branch information...
RalfJung committed Jul 6, 2019
1 parent 9007296 commit 1938edb4d96f2c442ca67ae13f130e3657d589d7
Showing with 2 additions and 27 deletions.
  1. +1 −1 src/librustc_mir/const_eval.rs
  2. +1 −26 src/librustc_mir/interpret/place.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| {
@@ -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> {

0 comments on commit 1938edb

Please sign in to comment.
You can’t perform that action at this time.