about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbendn <bend.n@outlook.com>2024-05-01 07:45:15 +0700
committerbendn <bend.n@outlook.com>2024-05-01 07:51:23 +0700
commita3ef100fa6fdb7d07c52b35d2462fa74cbf7ccd3 (patch)
treeaa4550196d17f6c2ef8db45e63bd9d50b551c4b1
parenta356785065cd31d1501f533393f4b2bdbd04075e (diff)
downloadrust-a3ef100fa6fdb7d07c52b35d2462fa74cbf7ccd3.tar.gz
rust-a3ef100fa6fdb7d07c52b35d2462fa74cbf7ccd3.zip
warning
-rw-r--r--clippy_lints/src/needless_for_each.rs10
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,