summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/comparison_chain.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /src/tools/clippy/tests/ui/comparison_chain.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/comparison_chain.rs')
-rw-r--r--src/tools/clippy/tests/ui/comparison_chain.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/comparison_chain.rs b/src/tools/clippy/tests/ui/comparison_chain.rs
index c12c6a310..266cee4c3 100644
--- a/src/tools/clippy/tests/ui/comparison_chain.rs
+++ b/src/tools/clippy/tests/ui/comparison_chain.rs
@@ -12,6 +12,7 @@ fn f(x: u8, y: u8, z: u8) {
}
if x > y {
+ //~^ ERROR: `if` chain can be rewritten with `match`
a()
} else if x < y {
b()
@@ -25,6 +26,7 @@ fn f(x: u8, y: u8, z: u8) {
}
if x > y {
+ //~^ ERROR: `if` chain can be rewritten with `match`
a()
} else if x < y {
b()
@@ -33,6 +35,7 @@ fn f(x: u8, y: u8, z: u8) {
}
if x > y {
+ //~^ ERROR: `if` chain can be rewritten with `match`
a()
} else if y > x {
b()
@@ -41,6 +44,7 @@ fn f(x: u8, y: u8, z: u8) {
}
if x > 1 {
+ //~^ ERROR: `if` chain can be rewritten with `match`
a()
} else if x < 1 {
b()
@@ -115,12 +119,14 @@ fn g(x: f64, y: f64, z: f64) {
fn h<T: Ord>(x: T, y: T, z: T) {
if x > y {
+ //~^ ERROR: `if` chain can be rewritten with `match`
a()
} else if x < y {
b()
}
if x > y {
+ //~^ ERROR: `if` chain can be rewritten with `match`
a()
} else if x < y {
b()
@@ -129,6 +135,7 @@ fn h<T: Ord>(x: T, y: T, z: T) {
}
if x > y {
+ //~^ ERROR: `if` chain can be rewritten with `match`
a()
} else if y > x {
b()