about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Hewson <michael@michaelhewson.ca>2017-11-09 09:16:55 -0500
committerMichael Hewson <michael@michaelhewson.ca>2017-11-09 09:16:55 -0500
commit31d3783050c1d09be1313ffdf6609dda7084cc98 (patch)
tree7750938d411bbc7c87d0a0a852a3d5ecbd08f043
parentdcbb27aa60f5105a49d5e416490d6549385c325d (diff)
downloadrust-31d3783050c1d09be1313ffdf6609dda7084cc98.tar.gz
rust-31d3783050c1d09be1313ffdf6609dda7084cc98.zip
fixed all the compile-fail error messages
now that we've fixed the bug where constraint origins were getting overwritten, the good error messages are back (with some tweaks)
-rw-r--r--src/test/compile-fail/explicit-self-lifetime-mismatch.rs14
-rw-r--r--src/test/compile-fail/issue-17740.rs10
-rw-r--r--src/test/compile-fail/ufcs-explicit-self-bad.rs15
3 files changed, 29 insertions, 10 deletions
diff --git a/src/test/compile-fail/explicit-self-lifetime-mismatch.rs b/src/test/compile-fail/explicit-self-lifetime-mismatch.rs
index 0c3ee1739a3..eac134ff3cc 100644
--- a/src/test/compile-fail/explicit-self-lifetime-mismatch.rs
+++ b/src/test/compile-fail/explicit-self-lifetime-mismatch.rs
@@ -1,5 +1,3 @@
-//~  ERROR mismatched types
-//~| ERROR mismatched types
 // 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.
@@ -16,7 +14,17 @@ struct Foo<'a,'b> {
 }
 
 impl<'a,'b> Foo<'a,'b> {
-    fn bar(self: Foo<'b,'a>) {}
+    fn bar(self:
+           Foo<'b,'a>
+    //~^ ERROR mismatched method receiver
+    //~| expected type `Foo<'a, 'b>`
+    //~| found type `Foo<'b, 'a>`
+    //~| lifetime mismatch
+    //~| ERROR mismatched method receiver
+    //~| expected type `Foo<'a, 'b>`
+    //~| found type `Foo<'b, 'a>`
+    //~| lifetime mismatch
+           ) {}
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/issue-17740.rs b/src/test/compile-fail/issue-17740.rs
index 99a7d39ce84..1d5ef4360dc 100644
--- a/src/test/compile-fail/issue-17740.rs
+++ b/src/test/compile-fail/issue-17740.rs
@@ -1,5 +1,3 @@
-//~  ERROR mismatched types
-//~| ERROR mismatched types
 // 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.
@@ -16,6 +14,14 @@ struct Foo<'a> {
 
 impl <'a> Foo<'a>{
     fn bar(self: &mut Foo) {
+    //~^ mismatched method receiver
+    //~| expected type `Foo<'a>`
+    //~| found type `Foo<'_>`
+    //~| lifetime mismatch
+    //~| mismatched method receiver
+    //~| expected type `Foo<'a>`
+    //~| found type `Foo<'_>`
+    //~| lifetime mismatch
     }
 }
 
diff --git a/src/test/compile-fail/ufcs-explicit-self-bad.rs b/src/test/compile-fail/ufcs-explicit-self-bad.rs
index 553fd79f5e5..5160ceaf48e 100644
--- a/src/test/compile-fail/ufcs-explicit-self-bad.rs
+++ b/src/test/compile-fail/ufcs-explicit-self-bad.rs
@@ -1,7 +1,3 @@
-//~  ERROR mismatched types
-//~| ERROR mismatched types
-//~| ERROR mismatched types
-//~| ERROR mismatched types
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
@@ -51,8 +47,17 @@ trait SomeTrait {
 
 impl<'a, T> SomeTrait for &'a Bar<T> {
     fn dummy1(self: &&'a Bar<T>) { }
-    fn dummy2(self: &Bar<T>) {}
+    fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver
+    //~^ ERROR mismatched method receiver
     fn dummy3(self: &&Bar<T>) {}
+    //~^ ERROR mismatched method receiver
+    //~| expected type `&'a Bar<T>`
+    //~| found type `&Bar<T>`
+    //~| lifetime mismatch
+    //~| ERROR mismatched method receiver
+    //~| expected type `&'a Bar<T>`
+    //~| found type `&Bar<T>`
+    //~| lifetime mismatch
 }
 
 fn main() {