From 4f1168aaa3c5ccbfc24f2843900ded1da5ce732d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 4 Nov 2019 09:37:53 +0100 Subject: [PATCH] expand Copy docs --- src/special-types-and-traits.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/special-types-and-traits.md b/src/special-types-and-traits.md index 9c2e0b1ff..24a034de2 100644 --- a/src/special-types-and-traits.md +++ b/src/special-types-and-traits.md @@ -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 [`!`]