@@ -211,6 +211,15 @@ impl Clone for Zst {
211211 }
212212}
213213
214+ enum Either < T , U > {
215+ Left ( T ) ,
216+ Right ( U ) ,
217+ }
218+ enum Either2 < T , U > {
219+ Left ( T ) ,
220+ Right ( U , ( ) ) ,
221+ }
222+
214223#[ repr( C ) ]
215224enum ReprCEnum < T > {
216225 Variant1 ,
@@ -328,7 +337,8 @@ mod unsized_ {
328337 test_transparent_unsized ! ( dyn_trait, dyn Any ) ;
329338}
330339
331- // RFC 3391 <https://rust-lang.github.io/rfcs/3391-result_ffi_guarantees.html>.
340+ // RFC 3391 <https://rust-lang.github.io/rfcs/3391-result_ffi_guarantees.html>, including the
341+ // extension ratified at <https://github.com/rust-lang/rust/pull/130628#issuecomment-2402761599>.
332342macro_rules! test_nonnull {
333343 ( $name: ident, $t: ty) => {
334344 mod $name {
@@ -340,6 +350,12 @@ macro_rules! test_nonnull {
340350 test_abi_compatible!( result_ok_zst, Result <Zst , $t>, $t) ;
341351 test_abi_compatible!( result_err_arr, Result <$t, [ i8 ; 0 ] >, $t) ;
342352 test_abi_compatible!( result_ok_arr, Result <[ i8 ; 0 ] , $t>, $t) ;
353+ test_abi_compatible!( result_err_void, Result <$t, Void >, $t) ;
354+ test_abi_compatible!( result_ok_void, Result <Void , $t>, $t) ;
355+ test_abi_compatible!( either_err_zst, Either <$t, Zst >, $t) ;
356+ test_abi_compatible!( either_ok_zst, Either <Zst , $t>, $t) ;
357+ test_abi_compatible!( either2_err_zst, Either2 <$t, Zst >, $t) ;
358+ test_abi_compatible!( either2_err_arr, Either2 <$t, [ i8 ; 0 ] >, $t) ;
343359 }
344360 }
345361}
0 commit comments