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.
This commit is contained in:
Mazdak Farrokhzad 2019-07-05 20:27:05 +02:00 committed by GitHub
commit 3c2cba847b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 11 deletions

View File

@ -275,17 +275,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 }