Skip to content

Commit de4b8f3

Browse files
committed
---
yaml --- r: 60569 b: refs/heads/auto c: 2460967 h: refs/heads/master i: 60567: bc2d41a v: v3
1 parent de8c035 commit de4b8f3

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 6d4845668f1755bb92c3053419cb182a4599f1d5
17+
refs/heads/auto: 24609675ebeff66f6299e98e4687618a48cf47e7
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/clone.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ by convention implementing the `Clone` trait and calling the
2525
use core::kinds::Const;
2626

2727
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.
3031
fn clone(&self) -> Self;
3132
}
3233

@@ -85,8 +86,9 @@ clone_impl!(bool)
8586
clone_impl!(char)
8687

8788
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.
9092
fn deep_clone(&self) -> Self;
9193
}
9294

0 commit comments

Comments
 (0)