diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
commit | c23a457e72abe608715ac76f076f47dc42af07a5 (patch) | |
tree | 2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /src/tools/clippy/tests/ui/needless_continue.rs | |
parent | Releasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-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/needless_continue.rs')
-rw-r--r-- | src/tools/clippy/tests/ui/needless_continue.rs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/tools/clippy/tests/ui/needless_continue.rs b/src/tools/clippy/tests/ui/needless_continue.rs index c891c9de3..c26a292c8 100644 --- a/src/tools/clippy/tests/ui/needless_continue.rs +++ b/src/tools/clippy/tests/ui/needless_continue.rs @@ -28,6 +28,7 @@ fn main() { let i = 0; println!("bar {} ", i); } else { + //~^ ERROR: this `else` block is redundant continue; } @@ -43,6 +44,7 @@ fn main() { } if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 { + //~^ ERROR: there is no need for an explicit `else` block for this `if` expression continue; } else { println!("Blabber"); @@ -55,21 +57,24 @@ fn main() { fn simple_loop() { loop { - continue; // should lint here + continue; + //~^ ERROR: this `continue` expression is redundant } } fn simple_loop2() { loop { println!("bleh"); - continue; // should lint here + continue; + //~^ ERROR: this `continue` expression is redundant } } #[rustfmt::skip] fn simple_loop3() { loop { - continue // should lint here + continue + //~^ ERROR: this `continue` expression is redundant } } @@ -77,7 +82,8 @@ fn simple_loop3() { fn simple_loop4() { loop { println!("bleh"); - continue // should lint here + continue + //~^ ERROR: this `continue` expression is redundant } } @@ -128,13 +134,15 @@ mod issue_2329 { if condition() { println!("bar-3"); } else { - continue 'inner; // should lint here + //~^ ERROR: this `else` block is redundant + continue 'inner; } println!("bar-4"); update_condition(); if condition() { - continue; // should lint here + //~^ ERROR: there is no need for an explicit `else` block for this `if` ex + continue; } else { println!("bar-5"); } |