about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-24 15:27:16 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-24 15:27:16 -0700
commit19cd00094c481b46ff8d8a7cd54bf65899d55d8a (patch)
treeeab7007a1265504d3a230c5b920bc4ac3ebae963 /src
parent3b13b9c2b4e72d08cb1c68024ccc4f50001f4878 (diff)
parent406524682bc54e821b78dc0ef5a30e6294d9997d (diff)
downloadrust-19cd00094c481b46ff8d8a7cd54bf65899d55d8a.tar.gz
rust-19cd00094c481b46ff8d8a7cd54bf65899d55d8a.zip
rollup merge of #23671: steveklabnik/doc_std_clone
Diffstat (limited to 'src')
-rw-r--r--src/libcore/clone.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs
index 058eff121e6..85e5bde4859 100644
--- a/src/libcore/clone.rs
+++ b/src/libcore/clone.rs
@@ -27,6 +27,14 @@ use marker::Sized;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait Clone : Sized {
     /// Returns a copy of the value.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let hello = "Hello"; // &str implements Clone
+    ///
+    /// assert_eq!("Hello", hello.clone());
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     fn clone(&self) -> Self;