File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,9 @@ by convention implementing the `Clone` trait and calling the
25
25
use core:: kinds:: Const ;
26
26
27
27
pub trait Clone {
28
- /// Return a deep copy of the owned object tree. Types with shared ownership like managed boxes
29
- /// are cloned with a shallow copy.
28
+ /// Returns a copy of the value. The contents of owned pointers
29
+ /// are copied to maintain uniqueness, while the contents of
30
+ /// managed pointers are not copied.
30
31
fn clone ( & self ) -> Self ;
31
32
}
32
33
@@ -85,8 +86,9 @@ clone_impl!(bool)
85
86
clone_impl ! ( char )
86
87
87
88
pub trait DeepClone {
88
- /// Return a deep copy of the object tree. Types with shared ownership are also copied via a
89
- /// deep copy, unlike `Clone`.
89
+ /// Return a deep copy of the value. Unlike `Clone`, the contents of shared pointer types
90
+ /// *are* copied. Note that this is currently unimplemented for managed boxes, as
91
+ /// it would need to handle cycles, but it is implemented for other smart-pointer types.
90
92
fn deep_clone ( & self ) -> Self ;
91
93
}
92
94
You can’t perform that action at this time.
0 commit comments