about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-07-19 07:26:24 +0000
committerbors <bors@rust-lang.org>2015-07-19 07:26:24 +0000
commit6b10efcc8b2cf9813efca5c0be3aaebf848fb82f (patch)
tree47699ecb856d3906d2597d549f8eaf8779d4a81b /src/test
parent86fa65bcc5882be3e1d3826a07bd3a0db88a045a (diff)
parent7d984ef6df64de8d7882912ccae16d39ded59a21 (diff)
downloadrust-6b10efcc8b2cf9813efca5c0be3aaebf848fb82f.tar.gz
rust-6b10efcc8b2cf9813efca5c0be3aaebf848fb82f.zip
Auto merge of #27121 - apasel422:issue-21332, r=Gankro
closes #21332
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/associated-const-impl-wrong-type.rs4
-rw-r--r--src/test/compile-fail/issue-15094.rs4
-rw-r--r--src/test/compile-fail/issue-20225.rs9
-rw-r--r--src/test/compile-fail/issue-21332.rs21
-rw-r--r--src/test/compile-fail/issue-24356.rs4
-rw-r--r--src/test/compile-fail/trait-impl-method-mismatch.rs4
-rw-r--r--src/test/compile-fail/unsafe-trait-impl.rs4
7 files changed, 42 insertions, 8 deletions
diff --git a/src/test/compile-fail/associated-const-impl-wrong-type.rs b/src/test/compile-fail/associated-const-impl-wrong-type.rs
index 4f20d9e78eb..4658d0f057d 100644
--- a/src/test/compile-fail/associated-const-impl-wrong-type.rs
+++ b/src/test/compile-fail/associated-const-impl-wrong-type.rs
@@ -18,7 +18,9 @@ struct SignedBar;
 
 impl Foo for SignedBar {
     const BAR: i32 = -1;
-    //~^ ERROR E0326
+    //~^ ERROR implemented const `BAR` has an incompatible type for trait
+    //~| expected u32,
+    //~| found i32 [E0326]
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/issue-15094.rs b/src/test/compile-fail/issue-15094.rs
index 3853434e128..42e3456b309 100644
--- a/src/test/compile-fail/issue-15094.rs
+++ b/src/test/compile-fail/issue-15094.rs
@@ -19,7 +19,9 @@ struct Debuger<T> {
 impl<T: fmt::Debug> ops::FnOnce<(),> for Debuger<T> {
     type Output = ();
     fn call_once(self, _args: ()) {
-//~^ ERROR `call_once` has an incompatible type for trait: expected "rust-call" fn, found "Rust" fn
+    //~^ ERROR `call_once` has an incompatible type for trait
+    //~| expected "rust-call" fn,
+    //~| found "Rust" fn
         println!("{:?}", self.x);
     }
 }
diff --git a/src/test/compile-fail/issue-20225.rs b/src/test/compile-fail/issue-20225.rs
index fe427e02451..b7845f1f116 100644
--- a/src/test/compile-fail/issue-20225.rs
+++ b/src/test/compile-fail/issue-20225.rs
@@ -14,19 +14,22 @@ struct Foo;
 
 impl<'a, T> Fn<(&'a T,)> for Foo {
   extern "rust-call" fn call(&self, (_,): (T,)) {}
-  //~^ ERROR: has an incompatible type for trait: expected &-ptr
+  //~^ ERROR: has an incompatible type for trait
+  //~| expected &-ptr
 }
 
 impl<'a, T> FnMut<(&'a T,)> for Foo {
   extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
-  //~^ ERROR: has an incompatible type for trait: expected &-ptr
+  //~^ ERROR: has an incompatible type for trait
+  //~| expected &-ptr
 }
 
 impl<'a, T> FnOnce<(&'a T,)> for Foo {
   type Output = ();
 
   extern "rust-call" fn call_once(self, (_,): (T,)) {}
-  //~^ ERROR: has an incompatible type for trait: expected &-ptr
+  //~^ ERROR: has an incompatible type for trait
+  //~| expected &-ptr
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/issue-21332.rs b/src/test/compile-fail/issue-21332.rs
new file mode 100644
index 00000000000..f25a9fd2762
--- /dev/null
+++ b/src/test/compile-fail/issue-21332.rs
@@ -0,0 +1,21 @@
+// Copyright 2015 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 S;
+
+impl Iterator for S {
+    type Item = i32;
+    fn next(&mut self) -> Result<i32, i32> { Ok(7) }
+    //~^ ERROR method `next` has an incompatible type for trait
+    //~| expected enum `core::option::Option`
+    //~|    found enum `core::result::Result` [E0053]
+}
+
+fn main() {}
diff --git a/src/test/compile-fail/issue-24356.rs b/src/test/compile-fail/issue-24356.rs
index 22f71835336..27d46be40fb 100644
--- a/src/test/compile-fail/issue-24356.rs
+++ b/src/test/compile-fail/issue-24356.rs
@@ -30,7 +30,9 @@ fn main() {
         impl Deref for Thing {
             //~^ ERROR not all trait items implemented, missing: `Target` [E0046]
             fn deref(&self) -> i8 { self.0 }
-            //~^ ERROR method `deref` has an incompatible type for trait: expected &-ptr, found i8 [E0053]
+            //~^ ERROR method `deref` has an incompatible type for trait
+            //~| expected &-ptr
+            //~| found i8 [E0053]
         }
 
         let thing = Thing(72);
diff --git a/src/test/compile-fail/trait-impl-method-mismatch.rs b/src/test/compile-fail/trait-impl-method-mismatch.rs
index 4e2eb224213..f86d9b7648b 100644
--- a/src/test/compile-fail/trait-impl-method-mismatch.rs
+++ b/src/test/compile-fail/trait-impl-method-mismatch.rs
@@ -16,7 +16,9 @@ trait Mumbo {
 impl Mumbo for usize {
     // Cannot have a larger effect than the trait:
     unsafe fn jumbo(&self, x: &usize) { *self + *x; }
-    //~^ ERROR expected normal fn, found unsafe fn
+    //~^ ERROR method `jumbo` has an incompatible type for trait
+    //~| expected normal fn,
+    //~| found unsafe fn
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/unsafe-trait-impl.rs b/src/test/compile-fail/unsafe-trait-impl.rs
index 71da2f7633f..51f876661f6 100644
--- a/src/test/compile-fail/unsafe-trait-impl.rs
+++ b/src/test/compile-fail/unsafe-trait-impl.rs
@@ -16,7 +16,9 @@ trait Foo {
 
 impl Foo for u32 {
     fn len(&self) -> u32 { *self }
-    //~^ ERROR incompatible type for trait: expected unsafe fn, found normal fn
+    //~^ ERROR method `len` has an incompatible type for trait
+    //~| expected unsafe fn,
+    //~| found normal fn
 }
 
 fn main() { }