]> git.lizzy.rs Git - rust.git/commitdiff
Fix clippy tests that trigger `for_loop_over_fallibles` lint
authorMaybe Waffle <waffle.lapkin@gmail.com>
Thu, 25 Aug 2022 10:03:13 +0000 (14:03 +0400)
committerMaybe Waffle <waffle.lapkin@gmail.com>
Sun, 9 Oct 2022 13:07:21 +0000 (13:07 +0000)
tests/ui/for_loop_unfixable.rs
tests/ui/for_loop_unfixable.stderr
tests/ui/for_loops_over_fallibles.rs

index efcaffce24ea4d3fc3689d943bde12d444a7644c..203656fa4d6c2a891b72f98aa6d7a4da49d5acfc 100644 (file)
@@ -8,6 +8,7 @@
     clippy::for_kv_map
 )]
 #[allow(clippy::linkedlist, clippy::unnecessary_mut_passed, clippy::similar_names)]
+#[allow(for_loop_over_fallibles)]
 fn main() {
     let vec = vec![1, 2, 3, 4];
 
index f769b4bdc941180c2a5587924192016138f2458a..50a86eaa68f7dffe5e4f632aea276cf3463a49bb 100644 (file)
@@ -1,5 +1,5 @@
 error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
-  --> $DIR/for_loop_unfixable.rs:14:15
+  --> $DIR/for_loop_unfixable.rs:15:15
    |
 LL |     for _v in vec.iter().next() {}
    |               ^^^^^^^^^^^^^^^^^
index 4b2a9297d084eba02835154bcc81789962cb3f03..54661ff94f2434a47580568b82a5ed977519129b 100644 (file)
@@ -1,5 +1,6 @@
 #![warn(clippy::for_loops_over_fallibles)]
 #![allow(clippy::uninlined_format_args)]
+#![allow(for_loop_over_fallibles)]
 
 fn for_loops_over_fallibles() {
     let option = Some(1);