Skip to content

Commit

Permalink
Merge pull request rust-lang#711 from RalfJung/copy
Browse files Browse the repository at this point in the history
expand Copy docs
  • Loading branch information
Centril committed Nov 4, 2019
2 parents 6f6c99f + 4f1168a commit 96ae518
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/special-types-and-traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ type is to be destroyed.

The [`Copy`] trait changes the semantics of a type implementing it. Values
whose type implements `Copy` are copied rather than moved upon assignment.
`Copy` cannot be implemented for types which implement `Drop`, or which have
fields that are not `Copy`. `Copy` is implemented by the compiler for

`Copy` can only be implemented for types which do not implement `Drop`, and whose fields are all `Copy`.
For enums, this means all fields of all variants have to be `Copy`.
For unions, this means all variants have to be `Copy`.

`Copy` is implemented by the compiler for

* [Numeric types]
* `char`, `bool`, and [`!`]
Expand Down

0 comments on commit 96ae518

Please sign in to comment.