diff options
| author | bors <bors@rust-lang.org> | 2013-05-20 16:55:36 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-20 16:55:36 -0700 |
| commit | 24609675ebeff66f6299e98e4687618a48cf47e7 (patch) | |
| tree | 5184c4680e3301a924c4008abebccced1174ec13 /src/libcore | |
| parent | 6d4845668f1755bb92c3053419cb182a4599f1d5 (diff) | |
| parent | 7ffd5233548b841b770b05a915ac6d103334c64f (diff) | |
auto merge of #6528 : brson/rust/docs, r=brson
Remove the uncommon term 'object tree' in favor of 'value'.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/clone.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs index 2650b96c408..2965b31a8c3 100644 --- a/src/libcore/clone.rs +++ b/src/libcore/clone.rs @@ -25,8 +25,9 @@ by convention implementing the `Clone` trait and calling the use core::kinds::Const; pub trait Clone { - /// Return a deep copy of the owned object tree. Types with shared ownership like managed boxes - /// are cloned with a shallow copy. + /// Returns a copy of the value. The contents of owned pointers + /// are copied to maintain uniqueness, while the contents of + /// managed pointers are not copied. fn clone(&self) -> Self; } @@ -85,8 +86,9 @@ clone_impl!(bool) clone_impl!(char) pub trait DeepClone { - /// Return a deep copy of the object tree. Types with shared ownership are also copied via a - /// deep copy, unlike `Clone`. + /// Return a deep copy of the value. Unlike `Clone`, the contents of shared pointer types + /// *are* copied. Note that this is currently unimplemented for managed boxes, as + /// it would need to handle cycles, but it is implemented for other smart-pointer types. fn deep_clone(&self) -> Self; } |
