about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2015-03-30 04:56:24 -0400
committerNiko Matsakis <niko@alum.mit.edu>2015-03-30 09:05:59 -0400
commite2b2a53d704899e5e59c943ab39fa692125233be (patch)
tree6b0ba0d42e2ab739c2369d3c572ae0c9c64a7e27
parentc92bdcb232da3973a8a548e6b2044b610e286210 (diff)
downloadrust-e2b2a53d704899e5e59c943ab39fa692125233be.tar.gz
rust-e2b2a53d704899e5e59c943ab39fa692125233be.zip
Fallout in tests: largely changes to error messages.
-rw-r--r--src/test/auxiliary/lang-item-public.rs17
-rw-r--r--src/test/compile-fail/assignment-operator-unimplemented.rs2
-rw-r--r--src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs3
-rw-r--r--src/test/compile-fail/binop-logic-float.rs5
-rw-r--r--src/test/compile-fail/binop-logic-int.rs4
-rw-r--r--src/test/compile-fail/fn-compare-mismatch.rs1
-rw-r--r--src/test/compile-fail/issue-11771.rs14
-rw-r--r--src/test/compile-fail/issue-2149.rs3
-rw-r--r--src/test/compile-fail/issue-5239-1.rs2
-rw-r--r--src/test/compile-fail/shift-various-bad-types.rs14
-rw-r--r--src/test/compile-fail/simd-binop.rs1
-rw-r--r--src/test/pretty/issue-929.rs13
-rw-r--r--src/test/run-fail/binop-fail-3.rs (renamed from src/test/compile-fail/binop-fail-3.rs)5
-rw-r--r--src/test/run-fail/bounds-check-no-overflow.rs2
-rw-r--r--src/test/run-pass/lang-item-public.rs2
15 files changed, 37 insertions, 51 deletions
diff --git a/src/test/auxiliary/lang-item-public.rs b/src/test/auxiliary/lang-item-public.rs
index 3c416dc2ef8..72dfc75f41b 100644
--- a/src/test/auxiliary/lang-item-public.rs
+++ b/src/test/auxiliary/lang-item-public.rs
@@ -35,18 +35,19 @@ pub trait Copy : PhantomFn<Self> {
 
 #[lang="rem"]
 pub trait Rem<RHS=Self> {
-    /// The resulting type after applying the `%` operator
-    #[stable(feature = "rust1", since = "1.0.0")]
     type Output = Self;
-
-    /// The method for the `%` operator
-    #[stable(feature = "rust1", since = "1.0.0")]
     fn rem(self, rhs: RHS) -> Self::Output;
 }
 
-impl Rem for i32 {
-    type Output = i32;
+impl Rem for isize {
+    type Output = isize;
 
     #[inline]
-    fn rem(self, other: i32) -> i32 { self % other }
+    fn rem(self, other: isize) -> isize {
+        // if you use `self % other` here, as one would expect, you
+        // get back an error because of potential failure/overflow,
+        // which tries to invoke error fns that don't have the
+        // appropriate signatures anymore. So...just return 0.
+        0
+    }
 }
diff --git a/src/test/compile-fail/assignment-operator-unimplemented.rs b/src/test/compile-fail/assignment-operator-unimplemented.rs
index 5b24c6bd79f..fef27af5957 100644
--- a/src/test/compile-fail/assignment-operator-unimplemented.rs
+++ b/src/test/compile-fail/assignment-operator-unimplemented.rs
@@ -13,5 +13,5 @@ struct Foo;
 fn main() {
   let mut a = Foo;
   let ref b = Foo;
-  a += *b; //~ Error: binary assignment operation `+=` cannot be applied to type `Foo`
+  a += *b; //~ Error: binary assignment operation `+=` cannot be applied to types `Foo` and `Foo`
 }
diff --git a/src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs b/src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs
index edd1b8255cc..04170779ed2 100644
--- a/src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs
+++ b/src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs
@@ -35,5 +35,6 @@ trait Add<RHS=Self> {
 fn ice<A>(a: A) {
     let r = loop {};
     r = r + a;
-    //~^ ERROR binary operation `+` cannot be applied to type `A`
+    //~^ ERROR not implemented
+    //~| ERROR not implemented
 }
diff --git a/src/test/compile-fail/binop-logic-float.rs b/src/test/compile-fail/binop-logic-float.rs
index 923d611cebe..f3fb5a08c85 100644
--- a/src/test/compile-fail/binop-logic-float.rs
+++ b/src/test/compile-fail/binop-logic-float.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern:`||` cannot be applied to type `f32`
-
 fn main() { let x = 1.0_f32 || 2.0_f32; }
+//~^ ERROR mismatched types
+//~| ERROR mismatched types
+
diff --git a/src/test/compile-fail/binop-logic-int.rs b/src/test/compile-fail/binop-logic-int.rs
index d5dd9e00902..f5e53f84c16 100644
--- a/src/test/compile-fail/binop-logic-int.rs
+++ b/src/test/compile-fail/binop-logic-int.rs
@@ -8,6 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern:`&&` cannot be applied to type `_`
-
 fn main() { let x = 1 && 2; }
+//~^ ERROR mismatched types
+//~| ERROR mismatched types
diff --git a/src/test/compile-fail/fn-compare-mismatch.rs b/src/test/compile-fail/fn-compare-mismatch.rs
index 6178d37a5bd..27be1ada445 100644
--- a/src/test/compile-fail/fn-compare-mismatch.rs
+++ b/src/test/compile-fail/fn-compare-mismatch.rs
@@ -13,4 +13,5 @@ fn main() {
     fn g() { }
     let x = f == g;
     //~^ ERROR binary operation `==` cannot be applied
+    //~| ERROR mismatched types
 }
diff --git a/src/test/compile-fail/issue-11771.rs b/src/test/compile-fail/issue-11771.rs
index 2de86e527ef..40fc6b1ed6a 100644
--- a/src/test/compile-fail/issue-11771.rs
+++ b/src/test/compile-fail/issue-11771.rs
@@ -11,19 +11,13 @@
 fn main() {
     let x = ();
     1 +
-    x //~  ERROR mismatched types
-      //~| expected `_`
-      //~| found `()`
-      //~| expected integral variable
-      //~| found ()
+    x //~^ ERROR E0277
+      //~| ERROR E0277
     ;
 
     let x: () = ();
     1 +
-    x //~  ERROR mismatched types
-      //~| expected `_`
-      //~| found `()`
-      //~| expected integral variable
-      //~| found ()
+    x //~^ ERROR E0277
+      //~| ERROR E0277
     ;
 }
diff --git a/src/test/compile-fail/issue-2149.rs b/src/test/compile-fail/issue-2149.rs
index 37dbcaf39bd..ea305c96af4 100644
--- a/src/test/compile-fail/issue-2149.rs
+++ b/src/test/compile-fail/issue-2149.rs
@@ -16,7 +16,8 @@ impl<A> vec_monad<A> for Vec<A> {
     fn bind<B, F>(&self, mut f: F) where F: FnMut(A) -> Vec<B> {
         let mut r = panic!();
         for elt in self { r = r + f(*elt); }
-        //~^ ERROR binary operation `+` cannot be applied to type `collections::vec::Vec<B>`
+        //~^ ERROR E0277
+        //~| ERROR E0277
    }
 }
 fn main() {
diff --git a/src/test/compile-fail/issue-5239-1.rs b/src/test/compile-fail/issue-5239-1.rs
index 49a43ee37ad..1ebef06008f 100644
--- a/src/test/compile-fail/issue-5239-1.rs
+++ b/src/test/compile-fail/issue-5239-1.rs
@@ -12,5 +12,5 @@
 
 fn main() {
     let x = |ref x: isize| -> isize { x += 1; };
-    //~^ ERROR binary assignment operation `+=` cannot be applied to type `&isize`
+    //~^ ERROR E0368
 }
diff --git a/src/test/compile-fail/shift-various-bad-types.rs b/src/test/compile-fail/shift-various-bad-types.rs
index 901ae1d5e2a..24b66213b39 100644
--- a/src/test/compile-fail/shift-various-bad-types.rs
+++ b/src/test/compile-fail/shift-various-bad-types.rs
@@ -17,19 +17,19 @@ struct Panolpy {
 
 fn foo(p: &Panolpy) {
     22 >> p.char;
-    //~^ ERROR right-hand-side of a shift operation must have integral type
+    //~^ ERROR E0277
+    //~| ERROR E0277
 
     22 >> p.str;
-    //~^ ERROR right-hand-side of a shift operation must have integral type
+    //~^ ERROR E0277
+    //~| ERROR E0277
 
     22 >> p;
-    //~^ ERROR right-hand-side of a shift operation must have integral type
+    //~^ ERROR E0277
+    //~| ERROR E0277
 
-    // We could be more accepting in the case of a type not yet inferred, but not
-    // known to be an integer, but meh.
     let x;
-    22 >> x;
-    //~^ ERROR the type of this value must be known in this context
+    22 >> x; // ambiguity error winds up being suppressed
 
     22 >> 1;
     // Integer literal types are OK
diff --git a/src/test/compile-fail/simd-binop.rs b/src/test/compile-fail/simd-binop.rs
index f028c9af462..feffe5c0b06 100644
--- a/src/test/compile-fail/simd-binop.rs
+++ b/src/test/compile-fail/simd-binop.rs
@@ -10,6 +10,7 @@
 
 // ignore-tidy-linelength
 
+#![feature(core)]
 
 use std::simd::f32x4;
 
diff --git a/src/test/pretty/issue-929.rs b/src/test/pretty/issue-929.rs
deleted file mode 100644
index 75a6b919342..00000000000
--- a/src/test/pretty/issue-929.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-// 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.
-//
-// 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.
-
-fn f() { if (1 == panic!()) { } else { } }
-
-fn main() { }
diff --git a/src/test/compile-fail/binop-fail-3.rs b/src/test/run-fail/binop-fail-3.rs
index 097a52b8941..8cabd3b3262 100644
--- a/src/test/compile-fail/binop-fail-3.rs
+++ b/src/test/run-fail/binop-fail-3.rs
@@ -8,9 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// error-pattern:quux
 fn foo() -> ! { panic!("quux"); }
 fn main() {
-    foo() //~ ERROR the type of this value must be known in this context
-    ==
-    foo();
+    foo() == foo(); // these types wind up being defaulted to ()
 }
diff --git a/src/test/run-fail/bounds-check-no-overflow.rs b/src/test/run-fail/bounds-check-no-overflow.rs
index c15c4b83828..4d502cb2106 100644
--- a/src/test/run-fail/bounds-check-no-overflow.rs
+++ b/src/test/run-fail/bounds-check-no-overflow.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern:index out of bounds: the len is 3 but the index is
+// error-pattern:assertion failed: index < self.len()
 
 use std::usize;
 use std::mem::size_of;
diff --git a/src/test/run-pass/lang-item-public.rs b/src/test/run-pass/lang-item-public.rs
index 780bb52b3e8..f5b9bd4fbaa 100644
--- a/src/test/run-pass/lang-item-public.rs
+++ b/src/test/run-pass/lang-item-public.rs
@@ -46,5 +46,5 @@ extern {}
 
 #[start]
 fn main(_: isize, _: *const *const u8) -> isize {
-    1 % 1
+    1_isize % 1_isize
 }