Skip to content

Commit a3ef100

Browse files
committed
warning
1 parent a356785 commit a3ef100

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

clippy_lints/src/needless_for_each.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ declare_clippy_lint! {
3535
/// println!("{}", elem);
3636
/// }
3737
/// ```
38+
///
39+
/// ### Known Problems
40+
/// When doing things such as:
41+
/// ```ignore
42+
/// let v = vec![0, 1, 2];
43+
/// v.iter().for_each(|elem| unsafe {
44+
/// libc::printf(c"%d\n".as_ptr(), elem);
45+
/// });
46+
/// ```
47+
/// This lint will not trigger.
3848
#[clippy::version = "1.53.0"]
3949
pub NEEDLESS_FOR_EACH,
4050
pedantic,

0 commit comments

Comments
 (0)