]> git.lizzy.rs Git - rust.git/commitdiff
restore a test
authorRalf Jung <post@ralfj.de>
Sun, 5 Jun 2022 16:00:43 +0000 (12:00 -0400)
committerRalf Jung <post@ralfj.de>
Sun, 5 Jun 2022 16:00:43 +0000 (12:00 -0400)
src/test/ui/cast/casts-issue-46365.rs

index a2205b718c1ca31579578a1636f0b2836a16d093..50aa1a856a7161fc576bdce44120f92cf9a7a50c 100644 (file)
@@ -3,5 +3,6 @@ struct Lorem {
 }
 
 fn main() {
-    let _foo: *mut Lorem = core::ptr::NonNull::dangling().as_ptr(); // no error here
+    // Testing `as` casts, so deliberately not using `ptr::null`.
+    let _foo: *mut Lorem = 0 as *mut _; // no error here
 }