summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/redundant_else.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/redundant_else.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/redundant_else.rs')
-rw-r--r--src/tools/clippy/tests/ui/redundant_else.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/redundant_else.rs b/src/tools/clippy/tests/ui/redundant_else.rs
index 64f566735..8bcf2ce52 100644
--- a/src/tools/clippy/tests/ui/redundant_else.rs
+++ b/src/tools/clippy/tests/ui/redundant_else.rs
@@ -8,6 +8,7 @@ fn main() {
println!("Love your neighbor;");
break;
} else {
+ //~^ ERROR: redundant else block
println!("yet don't pull down your hedge.");
}
// continue
@@ -15,6 +16,7 @@ fn main() {
println!("He that lies down with Dogs,");
continue;
} else {
+ //~^ ERROR: redundant else block
println!("shall rise up with fleas.");
}
// match block
@@ -24,6 +26,7 @@ fn main() {
_ => return,
}
} else {
+ //~^ ERROR: redundant else block
println!("You may delay, but time will not.");
}
}
@@ -33,6 +36,7 @@ fn main() {
} else if foo() {
return;
} else {
+ //~^ ERROR: redundant else block
println!("A fat kitchen makes a lean will.");
}
// let binding outside of block
@@ -40,6 +44,7 @@ fn main() {
if foo() {
return;
} else {
+ //~^ ERROR: redundant else block
1
}
};
@@ -50,6 +55,7 @@ fn main() {
} else if foo() {
return;
} else {
+ //~^ ERROR: redundant else block
2
}
};
@@ -59,6 +65,7 @@ fn main() {
if foo() {
return;
} else {
+ //~^ ERROR: redundant else block
1
}
} else {