]> git.lizzy.rs Git - rust.git/commitdiff
Adjust tests to more aggressive const err linting
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Mon, 29 Jan 2018 09:29:10 +0000 (10:29 +0100)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Thu, 8 Mar 2018 07:34:13 +0000 (08:34 +0100)
src/test/compile-fail/const-err-early.rs
src/test/compile-fail/const-err-multi.rs
src/test/compile-fail/eval-enum.rs
src/test/compile-fail/issue-8460-const.rs
src/test/ui/error-codes/E0080.rs

index 8c2e6233abfe26246b635d726bb35f9eff5cc6c0..2e19de0a27960c369e6d408ab3ffa62325cf0d82 100644 (file)
@@ -14,6 +14,7 @@
 pub const A: i8 = -std::i8::MIN; //~ ERROR E0080
 //~^ ERROR attempt to negate with overflow
 //~| ERROR const_err
+//~| ERROR const_err
 pub const B: u8 = 200u8 + 200u8; //~ ERROR E0080
 pub const C: u8 = 200u8 * 4; //~ ERROR E0080
 pub const D: u8 = 42u8 - (42u8 + 1); //~ ERROR E0080
index 668f95f2c8d730035c72c35852ebdf106862aca0..5fa31e05322b39fec222333aa8eebc146f82df2d 100644 (file)
@@ -13,6 +13,7 @@
 pub const A: i8 = -std::i8::MIN; //~ ERROR attempt to negate with overflow
 //~^ ERROR E0080
 //~| ERROR const_err
+//~| ERROR const_err
 pub const B: i8 = A;
 //~^ ERROR E0080
 pub const C: u8 = A as u8;
index 49f76c532df54d328f2605e21e6d4a9f5a330b4f..469618407d8f921263e0a063772ef1c63f95f230 100644 (file)
@@ -13,10 +13,12 @@ enum Test {
     //~^ attempt to divide by zero
     //~| ERROR constant evaluation error
     //~| WARN constant evaluation error
+    //~| WARN constant evaluation error
     RemZero = 1%0,
     //~^ attempt to calculate the remainder with a divisor of zero
     //~| ERROR constant evaluation error
     //~| WARN constant evaluation error
+    //~| WARN constant evaluation error
 }
 
 fn main() {}
index 1d59e75a0f0f028874ee69aa71269f949edf13c5..e2cf88d5774f75ca5084f29540003489034a4a2c 100644 (file)
@@ -17,61 +17,81 @@ fn main() {
     assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
     //~^ ERROR attempt to divide with overflow
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err());
     //~^ ERROR attempt to divide with overflow
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err());
     //~^ ERROR attempt to divide with overflow
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err());
     //~^ ERROR attempt to divide with overflow
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err());
     //~^ ERROR attempt to divide with overflow
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
     //~^ ERROR attempt to divide by zero
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err());
     //~^ ERROR attempt to divide by zero
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err());
     //~^ ERROR attempt to divide by zero
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err());
     //~^ ERROR attempt to divide by zero
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err());
     //~^ ERROR attempt to divide by zero
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
     //~^ ERROR attempt to calculate the remainder with overflow
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
     //~^ ERROR attempt to calculate the remainder with overflow
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
     //~^ ERROR attempt to calculate the remainder with overflow
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
     //~^ ERROR attempt to calculate the remainder with overflow
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
     //~^ ERROR attempt to calculate the remainder with overflow
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err());
     //~^ ERROR attempt to calculate the remainder with a divisor of zero
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err());
     //~^ ERROR attempt to calculate the remainder with a divisor of zero
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err());
     //~^ ERROR attempt to calculate the remainder with a divisor of zero
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err());
     //~^ ERROR attempt to calculate the remainder with a divisor of zero
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
     assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err());
     //~^ ERROR attempt to calculate the remainder with a divisor of zero
     //~| ERROR constant evaluation error
+    //~| ERROR constant evaluation error
 }
index 6e525d4ea9ec79eb98127e257c0296d6a31483a7..c8e425711284e529bfc4bb2d4184a677a1344b32 100644 (file)
@@ -13,6 +13,8 @@ enum Enum {
     //~| shift left with overflow
     Y = (1 / 0) //~ ERROR E0080
     //~| const_err
+    //~| const_err
+    //~| const_err
     //~| divide by zero
 }