Rollup merge of #97765 - RalfJung:restoration, r=Mark-Simulacrum

Restore a test that was intended to test `as` cast to ptr

This test was changed in https://github.com/rust-lang/rust/pull/61864, but the original bug https://github.com/rust-lang/rust/issues/46365 was about casts so I doubt the changed test still even tests what this was intended to test. Let's restore the original test.
This commit is contained in:
Matthias Krüger 2022-06-06 08:37:05 +02:00 committed by GitHub
commit 1258fa9d9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,5 +3,6 @@ struct Lorem {
} }
fn main() { 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
} }