]> git.lizzy.rs Git - rust.git/commitdiff
remove Scalar::is_null_ptr
authorRalf Jung <post@ralfj.de>
Fri, 5 Jul 2019 06:44:16 +0000 (08:44 +0200)
committerRalf Jung <post@ralfj.de>
Fri, 5 Jul 2019 06:44:19 +0000 (08:44 +0200)
Miri does not need it any more and it is otherwise unused

src/librustc/mir/interpret/value.rs

index 388c549324268452183254b523635654ffdb40ba..867565d5e0922bec9359ea8d1369dfcb7ca35abb 100644 (file)
@@ -275,17 +275,6 @@ pub fn get_ptr_offset(self, cx: &impl HasDataLayout) -> Size {
         }
     }
 
-    #[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 }