提交 24609675 编写于 作者: B bors

auto merge of #6528 : brson/rust/docs, r=brson

Remove the uncommon term 'object tree' in favor of 'value'.
......@@ -25,8 +25,9 @@ trait for them. For other types copies must be made explicitly,
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 @@ fn clone(&self) -> $t { *self }
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册