File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const DANGLING: NonNull<u32> = NonNull::dangling();
11
11
const CASTED : NonNull < u32 > = NonNull :: cast ( NonNull :: < i32 > :: dangling ( ) ) ;
12
12
13
13
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) ( ) ) ;
16
17
}
Original file line number Diff line number Diff line change @@ -11,5 +11,6 @@ use std::ptr::Unique;
11
11
const PTR : * mut u32 = Unique :: empty ( ) . as_ptr ( ) ;
12
12
13
13
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( ) ) ;
15
16
}
You can’t perform that action at this time.
0 commit comments