Skip to content

Commit 3f99ad1

Browse files
committed
extra paranoid mode
1 parent a733b87 commit 3f99ad1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/test/run-pass/consts/const-ptr-nonnull.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const DANGLING: NonNull<u32> = NonNull::dangling();
1111
const CASTED: NonNull<u32> = NonNull::cast(NonNull::<i32>::dangling());
1212

1313
pub fn main() {
14-
assert_eq!(DANGLING, b(NonNull::dangling)());
15-
assert_eq!(CASTED, b(NonNull::dangling)());
14+
// Be super-extra paranoid and cast the fn items to fn pointers before blackboxing them.
15+
assert_eq!(DANGLING, b::<fn() -> _>(NonNull::dangling)());
16+
assert_eq!(CASTED, b::<fn() -> _>(NonNull::dangling)());
1617
}

src/test/run-pass/consts/const-ptr-unique.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ use std::ptr::Unique;
1111
const PTR: *mut u32 = Unique::empty().as_ptr();
1212

1313
pub fn main() {
14-
assert_eq!(PTR, b(Unique::<u32>::empty)().as_ptr());
14+
// Be super-extra paranoid and cast the fn items to fn pointers before blackboxing them.
15+
assert_eq!(PTR, b::<fn() -> _>(Unique::<u32>::empty)().as_ptr());
1516
}

0 commit comments

Comments
 (0)