Skip to content

Commit 3c2cba8

Browse files
authored
Rollup merge of rust-lang#62396 - RalfJung:miri-no-null, r=alexcrichton
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.
2 parents 4ac3e62 + 50510e4 commit 3c2cba8

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/librustc/mir/interpret/value.rs

-11
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,6 @@ impl<'tcx, Tag> Scalar<Tag> {
275275
}
276276
}
277277

278-
#[inline]
279-
pub fn is_null_ptr(self, cx: &impl HasDataLayout) -> bool {
280-
match self {
281-
Scalar::Raw { data, size } => {
282-
assert_eq!(size as u64, cx.data_layout().pointer_size.bytes());
283-
data == 0
284-
},
285-
Scalar::Ptr(_) => false,
286-
}
287-
}
288-
289278
#[inline]
290279
pub fn from_bool(b: bool) -> Self {
291280
Scalar::Raw { data: b as u128, size: 1 }

0 commit comments

Comments
 (0)