Skip to content

Commit

Permalink
Rollup merge of #98579 - RalfJung:alloc-tests, r=thomcc
Browse files Browse the repository at this point in the history
liballoc tests: avoid int2ptr cast

I think we don't need `ptr::from_exposed_addr` here; `ptr::invalid` should be enough for this test. (And this makes Miri less unhappy when running these tests.)
  • Loading branch information
matthiaskrgr authored Jun 27, 2022
2 parents 9f66799 + 9b497ab commit b52c362
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/alloc/tests/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ fn test_format_macro_interface() {
{
let val = usize::MAX;
let exp = format!("{val:#x}");
t!(format!("{:p}", val as *const isize), exp);
t!(format!("{:p}", std::ptr::invalid::<isize>(val)), exp);
}

// Escaping
Expand Down

0 comments on commit b52c362

Please sign in to comment.