]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/never_loop.stderr
`assertions_on_result_states` fix suggestion when `assert!` not in a statement
[rust.git] / tests / ui / never_loop.stderr
index c00b4c78cf28b49182ec4441d84bcc9b10230ea9..f49b23924efe8b5c52fb807098bf3fd5760c570b 100644 (file)
@@ -75,6 +75,11 @@ LL | |             _ => return,
 LL | |         }
 LL | |     }
    | |_____^
+   |
+help: if you need the first element of the iterator, try writing
+   |
+LL |     if let Some(x) = (0..10).next() {
+   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error: this loop never actually loops
   --> $DIR/never_loop.rs:157:5