about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/manual_arithmetic_check-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/manual_arithmetic_check-2.rs')
-rw-r--r--src/tools/clippy/tests/ui/manual_arithmetic_check-2.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/manual_arithmetic_check-2.rs b/src/tools/clippy/tests/ui/manual_arithmetic_check-2.rs
index 749d15f1cbd..b094b2021b3 100644
--- a/src/tools/clippy/tests/ui/manual_arithmetic_check-2.rs
+++ b/src/tools/clippy/tests/ui/manual_arithmetic_check-2.rs
@@ -24,6 +24,15 @@ fn main() {
     let result = if b <= a { 0 } else { a - b };
     //~^ inverted_saturating_sub
 
+    let result = if b * 2 <= a { 0 } else { a - b * 2 };
+    //~^ inverted_saturating_sub
+
+    let result = if b <= a * 2 { 0 } else { a * 2 - b };
+    //~^ inverted_saturating_sub
+
+    let result = if b + 3 <= a + 2 { 0 } else { (a + 2) - (b + 3) };
+    //~^ inverted_saturating_sub
+
     let af = 12f32;
     let bf = 13f32;
     // Should not lint!