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 | 3fc903eb9578287f8e619b597e98b26e7a27b000 (patch) | |
| tree | 6be6a440bd6ac7e61c1e34736f001dac314e7734 | |
| parent | 4013d367fea84c6e6c8c83c4f1719ff13e354820 (diff) | |
| download | rust-3fc903eb9578287f8e619b597e98b26e7a27b000.tar.gz rust-3fc903eb9578287f8e619b597e98b26e7a27b000.zip | |
Fix clippy tests that trigger `for_loop_over_fallibles` lint
| -rw-r--r-- | tests/ui/for_loop_unfixable.rs | 1 | ||||
| -rw-r--r-- | tests/ui/for_loop_unfixable.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/for_loops_over_fallibles.rs | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/tests/ui/for_loop_unfixable.rs b/tests/ui/for_loop_unfixable.rs index efcaffce24e..203656fa4d6 100644 --- a/tests/ui/for_loop_unfixable.rs +++ b/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/tests/ui/for_loop_unfixable.stderr b/tests/ui/for_loop_unfixable.stderr index f769b4bdc94..50a86eaa68f 100644 --- a/tests/ui/for_loop_unfixable.stderr +++ b/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/tests/ui/for_loops_over_fallibles.rs b/tests/ui/for_loops_over_fallibles.rs index 4b2a9297d08..54661ff94f2 100644 --- a/tests/ui/for_loops_over_fallibles.rs +++ b/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); |
