@@ -307,19 +307,30 @@ mod arrays {
307
307
}
308
308
309
309
// Some tests with unsized types (not all wrappers are compatible with that).
310
+ macro_rules! assert_abi_compatible_unsized {
311
+ ( $name: ident, $t1: ty, $t2: ty) => {
312
+ mod $name {
313
+ use super :: * ;
314
+ // Declaring a `type` doesn't even check well-formedness, so we also declare a function.
315
+ fn check_wf( _x: $t1, _y: $t2) { }
316
+ // Can only test arguments and only the Rust ABI, since it's unsized.
317
+ #[ rustc_abi( assert_eq) ]
318
+ type TestRust = ( fn ( $t1) , fn ( $t2) ) ;
319
+ }
320
+ } ;
321
+ }
310
322
macro_rules! test_transparent_unsized {
311
323
( $name: ident, $t: ty) => {
312
324
mod $name {
313
325
use super :: * ;
314
- assert_abi_compatible !( wrap1, $t, Wrapper1 <$t>) ;
315
- assert_abi_compatible !( wrap1_reprc, ReprC1 <$t>, ReprC1 <Wrapper1 <$t>>) ;
316
- assert_abi_compatible !( wrap2, $t, Wrapper2 <$t>) ;
317
- assert_abi_compatible !( wrap2_reprc, ReprC1 <$t>, ReprC1 <Wrapper2 <$t>>) ;
326
+ assert_abi_compatible_unsized !( wrap1, $t, Wrapper1 <$t>) ;
327
+ assert_abi_compatible_unsized !( wrap1_reprc, ReprC1 <$t>, ReprC1 <Wrapper1 <$t>>) ;
328
+ assert_abi_compatible_unsized !( wrap2, $t, Wrapper2 <$t>) ;
329
+ assert_abi_compatible_unsized !( wrap2_reprc, ReprC1 <$t>, ReprC1 <Wrapper2 <$t>>) ;
318
330
}
319
331
} ;
320
332
}
321
333
322
- #[ cfg( not( any( target_arch = "mips64" , target_arch = "sparc64" ) ) ) ]
323
334
mod unsized_ {
324
335
use super :: * ;
325
336
test_transparent_unsized ! ( str_, str ) ;
0 commit comments