diff --git a/src/items/unions.md b/src/items/unions.md index 3c6c83d50..049564f2b 100644 --- a/src/items/unions.md +++ b/src/items/unions.md @@ -3,7 +3,7 @@ > **Syntax**\ > _Union_ :\ >    `union` [IDENTIFIER] [_GenericParams_]? [_WhereClause_]? -> `{`[_StructFields_] `}` +> `{`[_StructFields_]? `}` A union declaration uses the same syntax as a struct declaration, except with `union` in place of `struct`. @@ -30,6 +30,8 @@ This restriction ensures, in particular, that union fields never need to be dropped. Like for structs and enums, it is possible to `impl Drop` for a union to manually define what happens when it gets dropped. +Unions without any fields are not accepted by the compiler, but can be accepted by macros. + ## Initialization of a union A value of a union type can be created using the same syntax that is used for