about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-01 18:37:54 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-01 18:37:54 -0700
commitf92e7abefd0231f80d16062e5ff6aaf8cc3bc861 (patch)
treee8c5150252807a3b65c231c338627aaaef025f92 /src/doc
parent05654e528d9835f5b994241970bb4b6162665750 (diff)
parent449643301c1b30adf6b338174351219a58ffdb36 (diff)
downloadrust-f92e7abefd0231f80d16062e5ff6aaf8cc3bc861.tar.gz
rust-f92e7abefd0231f80d16062e5ff6aaf8cc3bc861.zip
rollup merge of #23860: nikomatsakis/copy-requires-clone
Conflicts:
	src/test/compile-fail/coherence-impls-copy.rs
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/reference.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md
index b3d5ad3b55d..cc90a69fd2a 100644
--- a/src/doc/reference.md
+++ b/src/doc/reference.md
@@ -1648,7 +1648,7 @@ specific type.
 Implementations are defined with the keyword `impl`.
 
 ```
-# #[derive(Copy)]
+# #[derive(Copy, Clone)]
 # struct Point {x: f64, y: f64};
 # type Surface = i32;
 # struct BoundingBox {x: f64, y: f64, width: f64, height: f64};
@@ -1661,6 +1661,10 @@ struct Circle {
 
 impl Copy for Circle {}
 
+impl Clone for Circle {
+    fn clone(&self) -> Circle { *self }
+}
+
 impl Shape for Circle {
     fn draw(&self, s: Surface) { do_draw_circle(s, *self); }
     fn bounding_box(&self) -> BoundingBox {