about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2014-10-17 09:12:25 -0400
committerNiko Matsakis <niko@alum.mit.edu>2014-10-21 12:32:36 -0400
commite09fc0370188eff0bd3e6f27f72ba4de0d1a6c24 (patch)
tree50c83f1c7f748f75453ec76bf8df91c5595b2f92 /src/test
parent7f8ca53669e71481201892e37ec57939e5f1ec85 (diff)
Various minor cases where errors are reported in slightly different ways.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-7575.rs19
-rw-r--r--src/test/compile-fail/selftype-traittype.rs2
-rw-r--r--src/test/compile-fail/unique-pinned-nocopy.rs2
-rw-r--r--src/test/compile-fail/unique-vec-res.rs4
-rw-r--r--src/test/compile-fail/vec-res-add.rs4
5 files changed, 19 insertions, 12 deletions
diff --git a/src/test/compile-fail/issue-7575.rs b/src/test/compile-fail/issue-7575.rs
index 768177785cf..d5a1040d4b4 100644
--- a/src/test/compile-fail/issue-7575.rs
+++ b/src/test/compile-fail/issue-7575.rs
@@ -8,17 +8,24 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// Test the mechanism for warning about possible missing `self` declarations.
+
 trait CtxtFn {
     fn f8(self, uint) -> uint;
-    fn f9(uint) -> uint; //~ NOTE candidate #
+    fn f9(uint) -> uint; //~ NOTE candidate
 }
 
 trait OtherTrait {
-    fn f9(uint) -> uint; //~ NOTE candidate #
+    fn f9(uint) -> uint; //~ NOTE candidate
 }
 
-trait UnusedTrait { // This should never show up as a candidate
-    fn f9(uint) -> uint;
+// Note: this trait is not implemented, but we can't really tell
+// whether or not an impl would match anyhow without a self
+// declaration to match against, so we wind up printing it as a
+// candidate. This seems not unreasonable -- perhaps the user meant to
+// implement it, after all.
+trait UnusedTrait {
+    fn f9(uint) -> uint; //~ NOTE candidate
 }
 
 impl CtxtFn for uint {
@@ -40,13 +47,13 @@ impl OtherTrait for uint {
 struct MyInt(int);
 
 impl MyInt {
-    fn fff(i: int) -> int { //~ NOTE candidate #1 is `MyInt::fff`
+    fn fff(i: int) -> int { //~ NOTE candidate
         i
     }
 }
 
 trait ManyImplTrait {
-    fn is_str() -> bool { //~ NOTE candidate #1 is
+    fn is_str() -> bool { //~ NOTE candidate
         false
     }
 }
diff --git a/src/test/compile-fail/selftype-traittype.rs b/src/test/compile-fail/selftype-traittype.rs
index bf7c3b261fd..44ee5002dce 100644
--- a/src/test/compile-fail/selftype-traittype.rs
+++ b/src/test/compile-fail/selftype-traittype.rs
@@ -14,7 +14,7 @@ trait add {
 }
 
 fn do_add(x: Box<add+'static>, y: Box<add+'static>) -> Box<add+'static> {
-    x.plus(y) //~ ERROR cannot call a method whose type contains a self-type through an object
+    x.plus(y) //~ ERROR E0038
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/unique-pinned-nocopy.rs b/src/test/compile-fail/unique-pinned-nocopy.rs
index c812b0d96a2..0e1e66b40ce 100644
--- a/src/test/compile-fail/unique-pinned-nocopy.rs
+++ b/src/test/compile-fail/unique-pinned-nocopy.rs
@@ -19,6 +19,6 @@ impl Drop for r {
 
 fn main() {
     let i = box r { b: true };
-    let _j = i.clone(); //~ ERROR not implemented
+    let _j = i.clone(); //~ ERROR not implement
     println!("{}", i);
 }
diff --git a/src/test/compile-fail/unique-vec-res.rs b/src/test/compile-fail/unique-vec-res.rs
index 79f29c6b359..62fabc0b33f 100644
--- a/src/test/compile-fail/unique-vec-res.rs
+++ b/src/test/compile-fail/unique-vec-res.rs
@@ -35,8 +35,8 @@ fn main() {
     let r1 = vec!(box r { i: i1 });
     let r2 = vec!(box r { i: i2 });
     f(r1.clone(), r2.clone());
-    //~^ ERROR the trait `core::clone::Clone` is not implemented
-    //~^^ ERROR the trait `core::clone::Clone` is not implemented
+    //~^ ERROR does not implement any method in scope named `clone`
+    //~^^ ERROR does not implement any method in scope named `clone`
     println!("{}", (r2, i1.get()));
     println!("{}", (r1, i2.get()));
 }
diff --git a/src/test/compile-fail/vec-res-add.rs b/src/test/compile-fail/vec-res-add.rs
index bfd52d69cb2..6221806642c 100644
--- a/src/test/compile-fail/vec-res-add.rs
+++ b/src/test/compile-fail/vec-res-add.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#[deriving(Show)]
 struct r {
   i:int
 }
@@ -23,7 +24,6 @@ fn main() {
     let i = vec!(r(0));
     let j = vec!(r(1));
     let k = i + j;
-    //~^ ERROR not implemented
+    //~^ ERROR binary operation `+` cannot be applied to type
     println!("{}", j);
-    //~^ ERROR not implemented
 }