]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/if_same_then_else.rs
Merge commit 'c2c07fa9d095931eb5684a42942a7b573a0c5238' into clippyup
[rust.git] / src / tools / clippy / tests / ui / if_same_then_else.rs
index 6bbf79edfcf700c75eb9444bb79ea12ef141af17..9c5fe02f7519bd25b178af70bf7b01da77520463 100644 (file)
@@ -142,4 +142,16 @@ fn func() {
 
 fn f(val: &[u8]) {}
 
+mod issue_5698 {
+    fn mul_not_always_commutative(x: i32, y: i32) -> i32 {
+        if x == 42 {
+            x * y
+        } else if x == 21 {
+            y * x
+        } else {
+            0
+        }
+    }
+}
+
 fn main() {}