File tree 1 file changed +4
-30
lines changed
1 file changed +4
-30
lines changed Original file line number Diff line number Diff line change @@ -401,34 +401,8 @@ enum DataCarryingSingleVariant {
401
401
* ` FieldSingleVariant ` has the same layout as ` UnitStruct ` ,
402
402
* ` DataCarryingSingleVariant ` has the same layout as ` SomeStruct ` .
403
403
404
- ### Layout of multi-variant enums with one inhabited variant
404
+ ## Unresolved questions
405
405
406
- > **NOTE**: the guarantees in this section have not been approved by an RFC process.
407
-
408
- The layout of **multi-variant** enums with **one inhabited variant** is the same
409
- as that of the single-variant enum containing that same inhabited variant.
410
-
411
- Here:
412
-
413
- ```rust
414
- # use std::mem::{size_of, align_of};
415
- struct SomeStruct { x: u32 }
416
- enum SingleVariantDataCarrying {
417
- DataCarryingVariant(SomeStruct),
418
- }
419
- enum Void0 {}
420
- enum Void1 {}
421
- enum MultiVariantSingleHabited {
422
- DataCarryingVariant (SomeStruct),
423
- Uninhabited0 (Void0),
424
- Uninhabited1 (Void1),
425
- }
426
- # fn main () {
427
- # use std::mem;
428
- # assert_eq!(size_of::<SingleVariantDataCarrying >(), size_of::<MultiVariantSingleHabited >());
429
- # assert_eq!(align_of::<SingleVariantDataCarrying >(), align_of::<MultiVariantSingleHabited >());
430
- # }
431
- ```
432
-
433
- the `MultiVariantSingleHabited` enum has the same layout as
434
- `SingleVariantDataCarrying`.
406
+ See [ Issue #79 .] ( https://github.com/rust-rfcs/unsafe-code-guidelines/issues/79 ) :
407
+
408
+ * Layout of multi-variant enums with one inhabited variant.
You can’t perform that action at this time.
0 commit comments