Skip to content

Commit 1938edb

Browse files
committed
remove some no-longer-needed methods
1 parent 9007296 commit 1938edb

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

src/librustc_mir/const_eval.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ pub fn const_eval_raw_provider<'tcx>(
661661
|body| eval_body_using_ecx(&mut ecx, cid, body, key.param_env)
662662
).and_then(|place| {
663663
Ok(RawConst {
664-
alloc_id: place.to_ptr().expect("we allocated this ptr!").alloc_id,
664+
alloc_id: place.ptr.assert_ptr().alloc_id,
665665
ty: place.layout.ty
666666
})
667667
}).map_err(|error| {

src/librustc_mir/interpret/place.rs

+1-26
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,6 @@ impl<Tag> MemPlace<Tag> {
122122
Self::from_scalar_ptr(ptr.into(), align)
123123
}
124124

125-
#[inline(always)]
126-
pub fn to_scalar_ptr_align(self) -> (Scalar<Tag>, Align) {
127-
assert!(self.meta.is_none());
128-
(self.ptr, self.align)
129-
}
130-
131-
/// metact the ptr part of the mplace
132-
#[inline(always)]
133-
pub fn to_ptr(self) -> InterpResult<'tcx, Pointer<Tag>> {
134-
// At this point, we forget about the alignment information --
135-
// the place has been turned into a reference, and no matter where it came from,
136-
// it now must be aligned.
137-
self.to_scalar_ptr_align().0.to_ptr()
138-
}
139-
140125
/// Turn a mplace into a (thin or fat) pointer, as a reference, pointing to the same space.
141126
/// This is the inverse of `ref_to_mplace`.
142127
#[inline(always)]
@@ -246,7 +231,7 @@ impl<'tcx, Tag: ::std::fmt::Debug + Copy> OpTy<'tcx, Tag> {
246231
}
247232
}
248233

249-
impl<'tcx, Tag: ::std::fmt::Debug> Place<Tag> {
234+
impl<Tag: ::std::fmt::Debug> Place<Tag> {
250235
/// Produces a Place that will error if attempted to be read from or written to
251236
#[inline(always)]
252237
pub fn null(cx: &impl HasDataLayout) -> Self {
@@ -271,16 +256,6 @@ impl<'tcx, Tag: ::std::fmt::Debug> Place<Tag> {
271256

272257
}
273258
}
274-
275-
#[inline]
276-
pub fn to_scalar_ptr_align(self) -> (Scalar<Tag>, Align) {
277-
self.assert_mem_place().to_scalar_ptr_align()
278-
}
279-
280-
#[inline]
281-
pub fn to_ptr(self) -> InterpResult<'tcx, Pointer<Tag>> {
282-
self.assert_mem_place().to_ptr()
283-
}
284259
}
285260

286261
impl<'tcx, Tag: ::std::fmt::Debug> PlaceTy<'tcx, Tag> {

0 commit comments

Comments
 (0)