Skip to content

Commit 96ae518

Browse files
authoredNov 4, 2019
Merge pull request #711 from RalfJung/copy
expand Copy docs
2 parents 6f6c99f + 4f1168a commit 96ae518

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/special-types-and-traits.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ type is to be destroyed.
6060

6161
The [`Copy`] trait changes the semantics of a type implementing it. Values
6262
whose type implements `Copy` are copied rather than moved upon assignment.
63-
`Copy` cannot be implemented for types which implement `Drop`, or which have
64-
fields that are not `Copy`. `Copy` is implemented by the compiler for
63+
64+
`Copy` can only be implemented for types which do not implement `Drop`, and whose fields are all `Copy`.
65+
For enums, this means all fields of all variants have to be `Copy`.
66+
For unions, this means all variants have to be `Copy`.
67+
68+
`Copy` is implemented by the compiler for
6569

6670
* [Numeric types]
6771
* `char`, `bool`, and [`!`]

0 commit comments

Comments
 (0)
Please sign in to comment.