@@ -211,6 +211,14 @@ impl Clone for Zst {
211
211
}
212
212
}
213
213
214
+ enum Either < T , U > {
215
+ Left ( T ) ,
216
+ Right ( U ) ,
217
+ } enum Either2 < T , U > {
218
+ Left ( T ) ,
219
+ Right ( U , ( ) ) ,
220
+ }
221
+
214
222
#[ repr( C ) ]
215
223
enum ReprCEnum < T > {
216
224
Variant1 ,
@@ -328,7 +336,8 @@ mod unsized_ {
328
336
test_transparent_unsized ! ( dyn_trait, dyn Any ) ;
329
337
}
330
338
331
- // RFC 3391 <https://rust-lang.github.io/rfcs/3391-result_ffi_guarantees.html>.
339
+ // RFC 3391 <https://rust-lang.github.io/rfcs/3391-result_ffi_guarantees.html>, including the
340
+ // extension ratified at <https://github.com/rust-lang/rust/pull/130628#issuecomment-2402761599>.
332
341
macro_rules! test_nonnull {
333
342
( $name: ident, $t: ty) => {
334
343
mod $name {
@@ -340,6 +349,10 @@ macro_rules! test_nonnull {
340
349
test_abi_compatible!( result_ok_zst, Result <Zst , $t>, $t) ;
341
350
test_abi_compatible!( result_err_arr, Result <$t, [ i8 ; 0 ] >, $t) ;
342
351
test_abi_compatible!( result_ok_arr, Result <[ i8 ; 0 ] , $t>, $t) ;
352
+ test_abi_compatible!( either_err_zst, Either <$t, Zst >, $t) ;
353
+ test_abi_compatible!( either_ok_zst, Either <Zst , $t>, $t) ;
354
+ test_abi_compatible!( either2_err_zst, Either2 <$t, Zst >, $t) ;
355
+ test_abi_compatible!( either2_err_arr, Either2 <$t, [ i8 ; 0 ] >, $t) ;
343
356
}
344
357
}
345
358
}
0 commit comments