Skip to content

Commit

Permalink
Rollup merge of #97765 - RalfJung:restoration, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Restore a test that was intended to test `as` cast to ptr

This test was changed in #61864, but the original bug #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.
  • Loading branch information
matthiaskrgr committed Jun 5, 2022
2 parents d8d7de0 + e5dd503 commit f6f8977
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/ui/cast/casts-issue-46365.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit f6f8977

Please sign in to comment.