diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2018-01-29 10:29:10 +0100 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2018-03-08 08:34:13 +0100 |
| commit | d57a109203526c2aa1c4bf88984726a82dd4bec8 (patch) | |
| tree | dbdc80dfc904e30651095a73020ba36fae5d65fc | |
| parent | 21554b96aff27d2d4ac2742bc4b00b52982933ca (diff) | |
| download | rust-d57a109203526c2aa1c4bf88984726a82dd4bec8.tar.gz rust-d57a109203526c2aa1c4bf88984726a82dd4bec8.zip | |
Adjust tests to more aggressive const err linting
| -rw-r--r-- | src/test/compile-fail/const-err-early.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/const-err-multi.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/eval-enum.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-8460-const.rs | 20 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0080.rs | 2 |
5 files changed, 26 insertions, 0 deletions
diff --git a/src/test/compile-fail/const-err-early.rs b/src/test/compile-fail/const-err-early.rs index 8c2e6233abf..2e19de0a279 100644 --- a/src/test/compile-fail/const-err-early.rs +++ b/src/test/compile-fail/const-err-early.rs @@ -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 diff --git a/src/test/compile-fail/const-err-multi.rs b/src/test/compile-fail/const-err-multi.rs index 668f95f2c8d..5fa31e05322 100644 --- a/src/test/compile-fail/const-err-multi.rs +++ b/src/test/compile-fail/const-err-multi.rs @@ -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; diff --git a/src/test/compile-fail/eval-enum.rs b/src/test/compile-fail/eval-enum.rs index 49f76c532df..469618407d8 100644 --- a/src/test/compile-fail/eval-enum.rs +++ b/src/test/compile-fail/eval-enum.rs @@ -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() {} diff --git a/src/test/compile-fail/issue-8460-const.rs b/src/test/compile-fail/issue-8460-const.rs index 1d59e75a0f0..e2cf88d5774 100644 --- a/src/test/compile-fail/issue-8460-const.rs +++ b/src/test/compile-fail/issue-8460-const.rs @@ -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 } diff --git a/src/test/ui/error-codes/E0080.rs b/src/test/ui/error-codes/E0080.rs index 6e525d4ea9e..c8e42571128 100644 --- a/src/test/ui/error-codes/E0080.rs +++ b/src/test/ui/error-codes/E0080.rs @@ -13,6 +13,8 @@ enum Enum { //~| shift left with overflow Y = (1 / 0) //~ ERROR E0080 //~| const_err + //~| const_err + //~| const_err //~| divide by zero } |
