Skip to content
Permalink
Browse files

black-box the fn ptr, not the result

  • Loading branch information...
RalfJung committed Jun 8, 2019
1 parent 4567f22 commit a733b876f7831d2273826753841194b4ba2a5260
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/test/run-pass/consts/const-ptr-nonnull.rs
  2. +1 −1 src/test/run-pass/consts/const-ptr-unique.rs
@@ -11,6 +11,6 @@ const DANGLING: NonNull<u32> = NonNull::dangling();
const CASTED: NonNull<u32> = NonNull::cast(NonNull::<i32>::dangling());

pub fn main() {
assert_eq!(DANGLING, b(NonNull::dangling()));
assert_eq!(CASTED, b(NonNull::dangling()));
assert_eq!(DANGLING, b(NonNull::dangling)());
assert_eq!(CASTED, b(NonNull::dangling)());
}
@@ -11,5 +11,5 @@ use std::ptr::Unique;
const PTR: *mut u32 = Unique::empty().as_ptr();

pub fn main() {
assert_eq!(PTR, b(Unique::<u32>::empty()).as_ptr());
assert_eq!(PTR, b(Unique::<u32>::empty)().as_ptr());
}

0 comments on commit a733b87

Please sign in to comment.
You can’t perform that action at this time.