[−][src]Static rustc_lint::array_into_iter::ARRAY_INTO_ITER
pub static ARRAY_INTO_ITER: &Lint
The array_into_iter lint detects calling into_iter on arrays.
Example
[1, 2, 3].into_iter().for_each(|n| { *n; });
{{produces}}
Explanation
In the future, it is planned to add an IntoIter implementation for
arrays such that it will iterate over values of the array instead of
references. Due to how method resolution works, this will change
existing code that uses into_iter on arrays. The solution to avoid
this warning is to use iter() instead of into_iter().
This is a future-incompatible lint to transition this to a hard error in the future. See issue #66145 for more details and a more thorough description of the lint.