Skip to content

Commit 9c64bb1

Browse files
committed
Fix clippy tests that trigger for_loop_over_fallibles lint
1 parent 98e0c4d commit 9c64bb1

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/tools/clippy/tests/ui/for_loop_unfixable.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
clippy::for_kv_map
99
)]
1010
#[allow(clippy::linkedlist, clippy::unnecessary_mut_passed, clippy::similar_names)]
11+
#[allow(for_loop_over_fallibles)]
1112
fn main() {
1213
let vec = vec![1, 2, 3, 4];
1314

src/tools/clippy/tests/ui/for_loop_unfixable.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
2-
--> $DIR/for_loop_unfixable.rs:14:15
2+
--> $DIR/for_loop_unfixable.rs:15:15
33
|
44
LL | for _v in vec.iter().next() {}
55
| ^^^^^^^^^^^^^^^^^

src/tools/clippy/tests/ui/for_loops_over_fallibles.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![warn(clippy::for_loops_over_fallibles)]
22
#![allow(clippy::uninlined_format_args)]
3+
#![allow(for_loop_over_fallibles)]
34

45
fn for_loops_over_fallibles() {
56
let option = Some(1);

0 commit comments

Comments
 (0)