about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-06-27 22:35:13 +0200
committerGitHub <noreply@github.com>2022-06-27 22:35:13 +0200
commitb52c362b8b9ccfc48f69cb27557e78ded7bb3568 (patch)
treec177d134bcd85a1b86bf54013d8db7ffd7b5a166
parent9f667994fdbc40285f670dd1ef8bcb4f6385dab7 (diff)
parent9b497abb9a5c661310722a85fabdce2fb8c02099 (diff)
downloadrust-b52c362b8b9ccfc48f69cb27557e78ded7bb3568.tar.gz
rust-b52c362b8b9ccfc48f69cb27557e78ded7bb3568.zip
Rollup merge of #98579 - RalfJung:alloc-tests, r=thomcc
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.)
-rw-r--r--library/alloc/tests/fmt.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/tests/fmt.rs b/library/alloc/tests/fmt.rs
index 67e12c612db..5ee6db43fda 100644
--- a/library/alloc/tests/fmt.rs
+++ b/library/alloc/tests/fmt.rs
@@ -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