Skip to content

Commit

Permalink
Rollup merge of rust-lang#62396 - RalfJung:miri-no-null, r=alexcrichton
Browse files Browse the repository at this point in the history
remove Scalar::is_null_ptr

Comparing pointers should be done more carefully than that. With rust-lang/miri#825, Miri does not need it any more and it is otherwise unused.
  • Loading branch information
Centril committed Jul 5, 2019
2 parents 4ac3e62 + 50510e4 commit 3c2cba8
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/librustc/mir/interpret/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 3c2cba8

Please sign in to comment.