Skip to content

Commit d2ee6e0

Browse files
committed
Emphasize semantic differences of Copy/Clone rather than impl
1 parent b4e123d commit d2ee6e0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libcore/clone.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ use marker::Sized;
4848

4949
/// A common trait for the ability to explicitly duplicate an object.
5050
///
51-
/// Differs from `Copy` in that you can
52-
/// define `Clone` to run arbitrary code, while you are not allowed to override
53-
/// the implementation of `Copy` that only does a `memcpy`.
51+
/// Differs from `Copy` in that `Copy` is implicit and extremely inexpensive, while
52+
/// `Clone` is always explicit and may or may not be expensive. In order to enforce
53+
/// these characteristics, Rust does not allow you to reimplement `Copy`, but you
54+
/// may reimplement `Clone` and run arbitrary code.
5455
///
5556
/// Since `Clone` is more general than `Copy`, you can automatically make anything
5657
/// `Copy` be `Clone` as well.

0 commit comments

Comments
 (0)