about summary refs log tree commit diff
path: root/src/libextra
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-01-28 00:20:50 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-01-28 11:07:45 +1100
commitcb02a370428afaae76db59080befe88b8c97e14d (patch)
treec967e91a172af8042410e066d1128357206105a8 /src/libextra
parentb0280ac5385433bd663e825e24f6990a816a5f40 (diff)
downloadrust-cb02a370428afaae76db59080befe88b8c97e14d.tar.gz
rust-cb02a370428afaae76db59080befe88b8c97e14d.zip
syntax: make deriving have slightly less cryptic error messages.
This unfortunately changes an error like

    error: mismatched types: expected `&&NotClone` but found `&NotClone`

into

    error: type `NotClone` does not implement any method in scope named `clone`
Diffstat (limited to 'src/libextra')
-rw-r--r--src/libextra/dlist.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libextra/dlist.rs b/src/libextra/dlist.rs
index 32079788942..4023a4d7e7f 100644
--- a/src/libextra/dlist.rs
+++ b/src/libextra/dlist.rs
@@ -47,13 +47,17 @@ struct Node<T> {
 }
 
 /// Double-ended DList iterator
-#[deriving(Clone)]
 pub struct Items<'a, T> {
     priv head: &'a Link<T>,
     priv tail: Rawlink<Node<T>>,
     priv nelem: uint,
 }
 
+// FIXME #11820: the &'a Option<> of the Link stops clone working.
+impl<'a, T> Clone for Items<'a, T> {
+    fn clone(&self) -> Items<'a, T> { *self }
+}
+
 /// Double-ended mutable DList iterator
 pub struct MutItems<'a, T> {
     priv list: &'a mut DList<T>,