@@ -71,6 +71,8 @@ fn main() {
71
71
test_abi_compat ( 0isize , 0i64 ) ;
72
72
}
73
73
test_abi_compat ( 42u32 , num:: NonZeroU32 :: new ( 1 ) . unwrap ( ) ) ;
74
+ // - `char` and `u32`.
75
+ test_abi_compat ( 42u32 , 'x' ) ;
74
76
// - Reference/pointer types with the same pointee.
75
77
test_abi_compat ( & 0u32 , & 0u32 as * const u32 ) ;
76
78
test_abi_compat ( & mut 0u32 as * mut u32 , Box :: new ( 0u32 ) ) ;
@@ -81,7 +83,7 @@ fn main() {
81
83
test_abi_compat ( main as fn ( ) , id :: < i32 > as fn ( i32 ) -> i32 ) ;
82
84
// - 1-ZST
83
85
test_abi_compat ( ( ) , [ 0u8 ; 0 ] ) ;
84
- // - Guaranteed null-pointer-optimizations.
86
+ // - Guaranteed null-pointer-optimizations (RFC 3391) .
85
87
test_abi_compat ( & 0u32 as * const u32 , Some ( & 0u32 ) ) ;
86
88
test_abi_compat ( main as fn ( ) , Some ( main as fn ( ) ) ) ;
87
89
test_abi_compat ( 0u32 , Some ( num:: NonZeroU32 :: new ( 1 ) . unwrap ( ) ) ) ;
@@ -103,6 +105,8 @@ fn main() {
103
105
test_abi_newtype :: < Option < num:: NonZeroU32 > > ( ) ;
104
106
105
107
// Extra test for assumptions made by arbitrary-self-dyn-receivers.
108
+ // This is interesting since these types are not `repr(transparent)`. So this is not part of our
109
+ // public ABI guarantees, but is relied on by the compiler.
106
110
let rc = Rc :: new ( 0 ) ;
107
111
let rc_ptr: * mut i32 = unsafe { mem:: transmute_copy ( & rc) } ;
108
112
test_abi_compat ( rc, rc_ptr) ;
0 commit comments