mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 20:45:45 +03:00
extra paranoid mode
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
const CASTED: NonNull<u32> = NonNull::cast(NonNull::<i32>::dangling());
|
||||
|
||||
pub fn main() {
|
||||
assert_eq!(DANGLING, b(NonNull::dangling)());
|
||||
assert_eq!(CASTED, b(NonNull::dangling)());
|
||||
// Be super-extra paranoid and cast the fn items to fn pointers before blackboxing them.
|
||||
assert_eq!(DANGLING, b::<fn() -> _>(NonNull::dangling)());
|
||||
assert_eq!(CASTED, b::<fn() -> _>(NonNull::dangling)());
|
||||
}
|
||||
|
||||
@@ -11,5 +11,6 @@
|
||||
const PTR: *mut u32 = Unique::empty().as_ptr();
|
||||
|
||||
pub fn main() {
|
||||
assert_eq!(PTR, b(Unique::<u32>::empty)().as_ptr());
|
||||
// Be super-extra paranoid and cast the fn items to fn pointers before blackboxing them.
|
||||
assert_eq!(PTR, b::<fn() -> _>(Unique::<u32>::empty)().as_ptr());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user