about summary refs log tree commit diff
path: root/src/test/compile-fail/deriving-no-inner-impl-error-message.rs
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/test/compile-fail/deriving-no-inner-impl-error-message.rs
parentb0280ac5385433bd663e825e24f6990a816a5f40 (diff)
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/test/compile-fail/deriving-no-inner-impl-error-message.rs')
-rw-r--r--src/test/compile-fail/deriving-no-inner-impl-error-message.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/compile-fail/deriving-no-inner-impl-error-message.rs b/src/test/compile-fail/deriving-no-inner-impl-error-message.rs
new file mode 100644
index 00000000000..604aa0dd06a
--- /dev/null
+++ b/src/test/compile-fail/deriving-no-inner-impl-error-message.rs
@@ -0,0 +1,24 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct NoCloneOrEq;
+
+#[deriving(Eq)]
+struct E {
+    x: NoCloneOrEq //~ ERROR does not implement any method in scope named `eq`
+         //~^ ERROR does not implement any method in scope named `ne`
+}
+#[deriving(Clone)]
+struct C {
+    x: NoCloneOrEq //~ ERROR does not implement any method in scope named `clone`
+}
+
+
+fn main() {}