You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using into_iter on an array within the size limits of the current impl IntoIterator for &[T; _] implementations you get a deny-by-default lint failure:
error: this .into_iter() call is equivalent to .iter() and will not move the array
--> src/main.rs:2:22
|
2 | for _ in [0; 32].into_iter() {
| ^^^^^^^^^ help: call directly: `iter`
|
= note: `#[deny(clippy::into_iter_on_array)]` on by default
If you increase the array size past those provided implementations you instead get a warn-by-default lint:
warning: this .into_iter() call is equivalent to .iter() and will not move the slice
--> src/main.rs:2:22
|
2 | for _ in [0; 33].into_iter() {
| ^^^^^^^^^ help: call directly: `iter`
|
= note: `#[warn(clippy::into_iter_on_ref)]` on by default
It seems both of these cases would be affected equally by a future const-generic powered impl<T, const N: usize> IntoIterator for [T; N].
The text was updated successfully, but these errors were encountered:
When using
into_iter
on an array within the size limits of the currentimpl IntoIterator for &[T; _]
implementations you get a deny-by-default lint failure:If you increase the array size past those provided implementations you instead get a warn-by-default lint:
It seems both of these cases would be affected equally by a future const-generic powered
impl<T, const N: usize> IntoIterator for [T; N]
.The text was updated successfully, but these errors were encountered: