@@ -211,6 +211,15 @@ impl Clone for Zst {
211
211
}
212
212
}
213
213
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
+
214
223
#[ repr( C ) ]
215
224
enum ReprCEnum < T > {
216
225
Variant1 ,
@@ -328,7 +337,8 @@ mod unsized_ {
328
337
test_transparent_unsized ! ( dyn_trait, dyn Any ) ;
329
338
}
330
339
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>.
332
342
macro_rules! test_nonnull {
333
343
( $name: ident, $t: ty) => {
334
344
mod $name {
@@ -340,6 +350,12 @@ macro_rules! test_nonnull {
340
350
test_abi_compatible!( result_ok_zst, Result <Zst , $t>, $t) ;
341
351
test_abi_compatible!( result_err_arr, Result <$t, [ i8 ; 0 ] >, $t) ;
342
352
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) ;
343
359
}
344
360
}
345
361
}
0 commit comments