about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/modulo_arithmetic_integral.rs
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2023-08-24 21:32:12 +0200
committerPhilipp Krones <hello@philkrones.com>2023-08-24 21:32:12 +0200
commit7137a09806171e75b54c5fb70bf629a55ff04d8b (patch)
treedcf4ea07d714ea0b97469e3e98c0cb74f92821ce /src/tools/clippy/tests/ui/modulo_arithmetic_integral.rs
parentaa5dbee3ebff8703456e8be3b5fb368fc68fe0d1 (diff)
parent080b587854a73f2a8cbaecff1884860a78e2ff37 (diff)
downloadrust-7137a09806171e75b54c5fb70bf629a55ff04d8b.tar.gz
rust-7137a09806171e75b54c5fb70bf629a55ff04d8b.zip
Merge commit '080b587854a73f2a8cbaecff1884860a78e2ff37' into clippyup
Diffstat (limited to 'src/tools/clippy/tests/ui/modulo_arithmetic_integral.rs')
-rw-r--r--src/tools/clippy/tests/ui/modulo_arithmetic_integral.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/modulo_arithmetic_integral.rs b/src/tools/clippy/tests/ui/modulo_arithmetic_integral.rs
index fc1acc39ebc..4dbed24026c 100644
--- a/src/tools/clippy/tests/ui/modulo_arithmetic_integral.rs
+++ b/src/tools/clippy/tests/ui/modulo_arithmetic_integral.rs
@@ -6,43 +6,77 @@ fn main() {
     let a = -1;
     let mut b = 2;
     a % b;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
     b % a;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
     b %= a;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
 
     let a_i8: i8 = 1;
     let mut b_i8: i8 = 2;
     a_i8 % b_i8;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
     b_i8 %= a_i8;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
 
     let a_i16: i16 = 1;
     let mut b_i16: i16 = 2;
     a_i16 % b_i16;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
     b_i16 %= a_i16;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
 
     let a_i32: i32 = 1;
     let mut b_i32: i32 = 2;
     a_i32 % b_i32;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
     b_i32 %= a_i32;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
 
     let a_i64: i64 = 1;
     let mut b_i64: i64 = 2;
     a_i64 % b_i64;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
     b_i64 %= a_i64;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
 
     let a_i128: i128 = 1;
     let mut b_i128: i128 = 2;
     a_i128 % b_i128;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
     b_i128 %= a_i128;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
 
     let a_isize: isize = 1;
     let mut b_isize: isize = 2;
     a_isize % b_isize;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
     b_isize %= a_isize;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
 
     let a = 1;
     let mut b = 2;
     a % b;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
     b %= a;
+    //~^ ERROR: you are using modulo operator on types that might have different signs
+    //~| NOTE: double check for expected result especially when interoperating with differ
 
     // No lint on unsigned integral value
     let a_u8: u8 = 17;