File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ declare_clippy_lint! {
1919 /// It's not bad, but having them is idiomatic and allows the type to be used in for loops directly
2020 /// (`for val in &iter {}`), without having to first call `iter()` or `iter_mut()`.
2121 ///
22+ /// ### Limitations
23+ /// This lint is restricted to exported types only, because it is aimed at guiding towards an
24+ /// idiomatic, _public_ API.
25+ /// Implementing the `IntoIterator` trait when it is not needed or used anywhere doesn't help or improve the code.
26+ ///
2227 /// ### Example
2328 /// ```rust
2429 /// struct MySlice<'a>(&'a [u8]);
@@ -61,6 +66,12 @@ declare_clippy_lint! {
6166 /// by just calling `.iter()`, instead of the more awkward `<&Type>::into_iter` or `(&val).into_iter()` syntax
6267 /// in case of ambiguity with another `IntoIterator` impl.
6368 ///
69+ /// ### Limitations
70+ /// This lint is restricted to exported types only, because it is aimed at guiding towards an
71+ /// idiomatic, _public_ API.
72+ /// Adding an `iter` or `iter_mut` for private types when it is not needed or used doesn't improve code,
73+ /// and in fact, is linted against by the `dead_code` lint.
74+ ///
6475 /// ### Example
6576 /// ```rust
6677 /// struct MySlice<'a>(&'a [u8]);
You can’t perform that action at this time.
0 commit comments