Skip into_iter() for arrays before 2021
This commit is contained in:
@@ -155,6 +155,10 @@ impl<T: fmt::Debug, const N: usize> fmt::Debug for [T; N] {
|
||||
}
|
||||
}
|
||||
|
||||
// Note: the `#[rustc_skip_array_during_method_dispatch]` on `trait IntoIterator`
|
||||
// hides this implementation from explicit `.into_iter()` calls on editions < 2021,
|
||||
// so those calls will still resolve to the slice implementation, by reference.
|
||||
#[cfg(not(bootstrap))]
|
||||
#[stable(feature = "array_into_iter_impl", since = "1.53.0")]
|
||||
impl<T, const N: usize> IntoIterator for [T; N] {
|
||||
type Item = T;
|
||||
|
||||
Reference in New Issue
Block a user