diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-08-25 14:03:13 +0400 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-10-09 13:07:21 +0000 |
| commit | 9c64bb1de14c58c76bbbcd0a5c1791e8d23b6443 (patch) | |
| tree | 1bca084fd683381b63ce64c3304d0bda95f78163 | |
| parent | 98e0c4df7384ca02f1d5c4dc5dc15de8b3418ce1 (diff) | |
| download | rust-9c64bb1de14c58c76bbbcd0a5c1791e8d23b6443.tar.gz rust-9c64bb1de14c58c76bbbcd0a5c1791e8d23b6443.zip | |
Fix clippy tests that trigger `for_loop_over_fallibles` lint
| -rw-r--r-- | src/tools/clippy/tests/ui/for_loop_unfixable.rs | 1 | ||||
| -rw-r--r-- | src/tools/clippy/tests/ui/for_loop_unfixable.stderr | 2 | ||||
| -rw-r--r-- | src/tools/clippy/tests/ui/for_loops_over_fallibles.rs | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/clippy/tests/ui/for_loop_unfixable.rs b/src/tools/clippy/tests/ui/for_loop_unfixable.rs index efcaffce24e..203656fa4d6 100644 --- a/src/tools/clippy/tests/ui/for_loop_unfixable.rs +++ b/src/tools/clippy/tests/ui/for_loop_unfixable.rs @@ -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]; diff --git a/src/tools/clippy/tests/ui/for_loop_unfixable.stderr b/src/tools/clippy/tests/ui/for_loop_unfixable.stderr index f769b4bdc94..50a86eaa68f 100644 --- a/src/tools/clippy/tests/ui/for_loop_unfixable.stderr +++ b/src/tools/clippy/tests/ui/for_loop_unfixable.stderr @@ -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() {} | ^^^^^^^^^^^^^^^^^ diff --git a/src/tools/clippy/tests/ui/for_loops_over_fallibles.rs b/src/tools/clippy/tests/ui/for_loops_over_fallibles.rs index 4b2a9297d08..54661ff94f2 100644 --- a/src/tools/clippy/tests/ui/for_loops_over_fallibles.rs +++ b/src/tools/clippy/tests/ui/for_loops_over_fallibles.rs @@ -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); |
