mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
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:
commit
1258fa9d9b
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user