about summary refs log tree commit diff
path: root/tests/ui/while_let_loop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/while_let_loop.rs')
-rw-r--r--tests/ui/while_let_loop.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/ui/while_let_loop.rs b/tests/ui/while_let_loop.rs
index 5b8075731cb..fa5325bebff 100644
--- a/tests/ui/while_let_loop.rs
+++ b/tests/ui/while_let_loop.rs
@@ -1,9 +1,11 @@
 #![warn(clippy::while_let_loop)]
 #![allow(clippy::uninlined_format_args)]
-
+//@no-rustfix
 fn main() {
     let y = Some(true);
     loop {
+        //~^ ERROR: this loop could be written as a `while let` loop
+        //~| NOTE: `-D clippy::while-let-loop` implied by `-D warnings`
         if let Some(_x) = y {
             let _v = 1;
         } else {
@@ -21,6 +23,7 @@ fn main() {
     }
 
     loop {
+        //~^ ERROR: this loop could be written as a `while let` loop
         match y {
             Some(_x) => true,
             None => break,
@@ -28,6 +31,7 @@ fn main() {
     }
 
     loop {
+        //~^ ERROR: this loop could be written as a `while let` loop
         let x = match y {
             Some(x) => x,
             None => break,
@@ -37,6 +41,7 @@ fn main() {
     }
 
     loop {
+        //~^ ERROR: this loop could be written as a `while let` loop
         let x = match y {
             Some(x) => x,
             None => break,
@@ -67,6 +72,7 @@ fn main() {
 
     // #675, this used to have a wrong suggestion
     loop {
+        //~^ ERROR: this loop could be written as a `while let` loop
         let (e, l) = match "".split_whitespace().next() {
             Some(word) => (word.is_empty(), word.len()),
             None => break,