about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-05 20:27:05 +0200
committerGitHub <noreply@github.com>2019-07-05 20:27:05 +0200
commit3c2cba847b0e4d1bfd4c810cee08303034bbe2d5 (patch)
tree3191f194e008b97571aabcc719f4619b39c3e3bc
parent4ac3e626a76ddf028f885fcbb0083786f0d6f933 (diff)
parent50510e4491ea8225c3abe997fe27f0c53e0094e2 (diff)
downloadrust-3c2cba847b0e4d1bfd4c810cee08303034bbe2d5.tar.gz
rust-3c2cba847b0e4d1bfd4c810cee08303034bbe2d5.zip
Rollup merge of #62396 - RalfJung:miri-no-null, r=alexcrichton
remove Scalar::is_null_ptr

Comparing pointers should be done more carefully than that. With https://github.com/rust-lang/miri/pull/825, Miri does not need it any more and it is otherwise unused.
-rw-r--r--src/librustc/mir/interpret/value.rs11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/librustc/mir/interpret/value.rs b/src/librustc/mir/interpret/value.rs
index 388c5493242..867565d5e09 100644
--- a/src/librustc/mir/interpret/value.rs
+++ b/src/librustc/mir/interpret/value.rs
@@ -276,17 +276,6 @@ impl<'tcx, Tag> Scalar<Tag> {
     }
 
     #[inline]
-    pub fn is_null_ptr(self, cx: &impl HasDataLayout) -> bool {
-        match self {
-            Scalar::Raw { data, size } => {
-                assert_eq!(size as u64, cx.data_layout().pointer_size.bytes());
-                data == 0
-            },
-            Scalar::Ptr(_) => false,
-        }
-    }
-
-    #[inline]
     pub fn from_bool(b: bool) -> Self {
         Scalar::Raw { data: b as u128, size: 1 }
     }