diff options
| author | bendn <bend.n@outlook.com> | 2024-05-01 07:45:15 +0700 |
|---|---|---|
| committer | bendn <bend.n@outlook.com> | 2024-05-01 07:51:23 +0700 |
| commit | a3ef100fa6fdb7d07c52b35d2462fa74cbf7ccd3 (patch) | |
| tree | aa4550196d17f6c2ef8db45e63bd9d50b551c4b1 | |
| parent | a356785065cd31d1501f533393f4b2bdbd04075e (diff) | |
| download | rust-a3ef100fa6fdb7d07c52b35d2462fa74cbf7ccd3.tar.gz rust-a3ef100fa6fdb7d07c52b35d2462fa74cbf7ccd3.zip | |
warning
| -rw-r--r-- | clippy_lints/src/needless_for_each.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clippy_lints/src/needless_for_each.rs b/clippy_lints/src/needless_for_each.rs index 3fe3d50197d..630018238f4 100644 --- a/clippy_lints/src/needless_for_each.rs +++ b/clippy_lints/src/needless_for_each.rs @@ -35,6 +35,16 @@ declare_clippy_lint! { /// println!("{}", elem); /// } /// ``` + /// + /// ### Known Problems + /// When doing things such as: + /// ```ignore + /// let v = vec![0, 1, 2]; + /// v.iter().for_each(|elem| unsafe { + /// libc::printf(c"%d\n".as_ptr(), elem); + /// }); + /// ``` + /// This lint will not trigger. #[clippy::version = "1.53.0"] pub NEEDLESS_FOR_EACH, pedantic, |
