diff options
| author | Jonas Schievink <jonasschievink@gmail.com> | 2020-04-16 01:23:29 +0200 |
|---|---|---|
| committer | Jonas Schievink <jonasschievink@gmail.com> | 2020-04-20 21:18:20 +0200 |
| commit | a417f963fe58e2f6ba5e93be7fa960afa238720c (patch) | |
| tree | c967d8e152f3d98fbfc3084704cf8ed338c917ed /src/librustc_mir | |
| parent | 4eaf535d2b4f8c5937f2c24ac8e99b02f893460b (diff) | |
| download | rust-a417f963fe58e2f6ba5e93be7fa960afa238720c.tar.gz rust-a417f963fe58e2f6ba5e93be7fa960afa238720c.zip | |
Remove null places
Diffstat (limited to 'src/librustc_mir')
| -rw-r--r-- | src/librustc_mir/interpret/place.rs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/librustc_mir/interpret/place.rs b/src/librustc_mir/interpret/place.rs index ca7148714ac..e961d4fce04 100644 --- a/src/librustc_mir/interpret/place.rs +++ b/src/librustc_mir/interpret/place.rs @@ -135,12 +135,6 @@ impl<Tag> MemPlace<Tag> { MemPlace { ptr, align, meta: MemPlaceMeta::None } } - /// Produces a Place that will error if attempted to be read from or written to - #[inline(always)] - fn null(cx: &impl HasDataLayout) -> Self { - Self::from_scalar_ptr(Scalar::null_ptr(cx), Align::from_bytes(1).unwrap()) - } - #[inline(always)] pub fn from_ptr(ptr: Pointer<Tag>, align: Align) -> Self { Self::from_scalar_ptr(ptr.into(), align) @@ -260,12 +254,6 @@ impl<'tcx, Tag: ::std::fmt::Debug + Copy> OpTy<'tcx, 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)] - fn null(cx: &impl HasDataLayout) -> Self { - Place::Ptr(MemPlace::null(cx)) - } - #[inline] pub fn assert_mem_place(self) -> MemPlace<Tag> { match self { @@ -276,10 +264,6 @@ impl<Tag: ::std::fmt::Debug> Place<Tag> { } impl<'tcx, Tag: ::std::fmt::Debug> PlaceTy<'tcx, Tag> { - pub fn null(cx: &impl HasDataLayout, layout: TyAndLayout<'tcx>) -> Self { - Self { place: Place::null(cx), layout } - } - #[inline] pub fn assert_mem_place(self) -> MPlaceTy<'tcx, Tag> { MPlaceTy { mplace: self.place.assert_mem_place(), layout: self.layout } |
