]> git.lizzy.rs Git - rust.git/commitdiff
Fallout in tests: largely changes to error messages.
authorNiko Matsakis <niko@alum.mit.edu>
Mon, 30 Mar 2015 08:56:24 +0000 (04:56 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Mon, 30 Mar 2015 13:05:59 +0000 (09:05 -0400)
16 files changed:
src/test/auxiliary/lang-item-public.rs
src/test/compile-fail/assignment-operator-unimplemented.rs
src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs
src/test/compile-fail/binop-fail-3.rs [deleted file]
src/test/compile-fail/binop-logic-float.rs
src/test/compile-fail/binop-logic-int.rs
src/test/compile-fail/fn-compare-mismatch.rs
src/test/compile-fail/issue-11771.rs
src/test/compile-fail/issue-2149.rs
src/test/compile-fail/issue-5239-1.rs
src/test/compile-fail/shift-various-bad-types.rs
src/test/compile-fail/simd-binop.rs
src/test/pretty/issue-929.rs [deleted file]
src/test/run-fail/binop-fail-3.rs [new file with mode: 0644]
src/test/run-fail/bounds-check-no-overflow.rs
src/test/run-pass/lang-item-public.rs

index 3c416dc2ef8d1168bed446ed3af5b251840bf297..72dfc75f41b969747eba45465ab47b37a773825d 100644 (file)
@@ -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
+    }
 }
index 5b24c6bd79f96e75a4666054d35232886241a4a3..fef27af59571b186748d84cc7aed01b6d41b5d48 100644 (file)
@@ -13,5 +13,5 @@
 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`
 }
index edd1b8255ccdc38e6a4b1f7459443f0f0bda90e9..04170779ed2f6b05ae583cbdd7019c1bfa8acd6a 100644 (file)
@@ -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-fail-3.rs b/src/test/compile-fail/binop-fail-3.rs
deleted file mode 100644 (file)
index 097a52b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2013 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 foo() -> ! { panic!("quux"); }
-fn main() {
-    foo() //~ ERROR the type of this value must be known in this context
-    ==
-    foo();
-}
index 923d611cebeeaa01ca948632f09abae2385bb4ab..f3fb5a08c854189ecbd74d5e1302c33e1dae045e 100644 (file)
@@ -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
+
index d5dd9e00902f9d40b53fc5cfe1776f254d1c93bf..f5e53f84c16e6472dc4b39c3aca8a084cba288e7 100644 (file)
@@ -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
index 6178d37a5bd6c49bde6c12afb451d56db2ffceff..27be1ada445505dbd4c54d5aad0996cf178135ea 100644 (file)
@@ -13,4 +13,5 @@ fn f() { }
     fn g() { }
     let x = f == g;
     //~^ ERROR binary operation `==` cannot be applied
+    //~| ERROR mismatched types
 }
index 2de86e527ef594460289a4307d522cd75e6918a1..40fc6b1ed6aaacebf6a682e43b67d369b5dff5ab 100644 (file)
 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
     ;
 }
index 37dbcaf39bd10ba17c99dfdc6c30f9a243a3a851..ea305c96af4a1efa39f788effa5df7a31b99aad8 100644 (file)
@@ -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() {
index 49a43ee37adca88d9ec5224a79b161945a0354f0..1ebef06008ffa4f3c6b345dee1cd6110d7d62132 100644 (file)
@@ -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
 }
index 901ae1d5e2ab1584e6d3053ee7d36942be4c019d..24b66213b39bd410cdffb9d011bd6b38caa63ab4 100644 (file)
@@ -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
index f028c9af46235647a0fbe65c47fdbf8dd169fe63..feffe5c0b06c8e09fc10dcd75c68c9cec4ff21f6 100644 (file)
@@ -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 (file)
index 75a6b91..0000000
+++ /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/run-fail/binop-fail-3.rs b/src/test/run-fail/binop-fail-3.rs
new file mode 100644 (file)
index 0000000..8cabd3b
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2013 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.
+
+// error-pattern:quux
+fn foo() -> ! { panic!("quux"); }
+fn main() {
+    foo() == foo(); // these types wind up being defaulted to ()
+}
index c15c4b83828a34bff88dde7f2c43eea5a36535b8..4d502cb2106b116eaa6eb28e8cedfcfcd72449be 100644 (file)
@@ -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;
index 780bb52b3e8b7cf8e6ab5fdeaed579d67de6f45e..f5b9bd4fbaa69b800f332b2e333afe0975358c90 100644 (file)
@@ -46,5 +46,5 @@
 
 #[start]
 fn main(_: isize, _: *const *const u8) -> isize {
-    1 % 1
+    1_isize % 1_isize
 }