Skip to content

Commit 1258fa9

Browse files
authored
Rollup merge of rust-lang#97765 - RalfJung:restoration, r=Mark-Simulacrum
Restore a test that was intended to test `as` cast to ptr This test was changed in rust-lang#61864, but the original bug rust-lang#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.
2 parents 1bf1932 + e5dd503 commit 1258fa9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/ui/cast/casts-issue-46365.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ struct Lorem {
33
}
44

55
fn main() {
6-
let _foo: *mut Lorem = core::ptr::NonNull::dangling().as_ptr(); // no error here
6+
// Testing `as` casts, so deliberately not using `ptr::null`.
7+
let _foo: *mut Lorem = 0 as *mut _; // no error here
78
}

0 commit comments

Comments
 (0)