Skip to content

Commit 9b497ab

Browse files
committed
liballoc tests: avoid int2ptr cast
1 parent 221bdb6 commit 9b497ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/alloc/tests/fmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fn test_format_macro_interface() {
207207
{
208208
let val = usize::MAX;
209209
let exp = format!("{val:#x}");
210-
t!(format!("{:p}", val as *const isize), exp);
210+
t!(format!("{:p}", std::ptr::invalid::<isize>(val)), exp);
211211
}
212212

213213
// Escaping

0 commit comments

Comments
 (0)