File tree 1 file changed +22
-1
lines changed
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -805,12 +805,33 @@ Union Types
805
805
.. rubric :: Legality Rules
806
806
807
807
:dp: `fls_nskmnzq95yqm `
808
- A :t: `union type ` is an :t: `abstract data type ` similar to a :t: `C `-like union.
808
+ A :t: `union type ` is an :t: `abstract data type ` that is a sum of other
809
+ :t: `types `.
809
810
810
811
:dp: `fls_1caus8ybmfli `
811
812
The :t: `name ` of a :t: `union field ` shall be unique within the related
812
813
:s: `RecordStructDeclaration `.
813
814
815
+ :dp: `fls_ZJG2Q6lJYXhY `
816
+ The :t: `type ` of a :t: `union field ` shall be either:
817
+
818
+ * :dp: `fls_hLTnHnZuaHve `
819
+ A :t: `copy type `, or
820
+
821
+ * :dp: `fls_JWgSckDtN13c `
822
+ A :t: `mutable reference type `, or
823
+
824
+ * :dp: `fls_sXZknxozJxtC `
825
+ :std: `core::mem::ManuallyDrop `, or
826
+
827
+ * :dp: `fls_vgNK01SXacnx `
828
+ A :t: `tuple type ` whose :t: `[tuple field]s `' :t: `[type]s ` are all valid
829
+ :t: `union field ` :t: `[type]s `, or
830
+
831
+ * :dp: `fls_bQhh3zHAKjSu `
832
+ An :t: `array type ` whose :t: `element type ` is a valid :t: `union field `
833
+ :t: `[type]s `.
834
+
814
835
.. rubric :: Examples
815
836
816
837
.. code-block :: rust
You can’t perform that action at this time.
0 commit comments