File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,10 @@ impl<T: fmt::Debug, const N: usize> fmt::Debug for [T; N] {
155155 }
156156}
157157
158+ // Note: the `#[rustc_skip_array_during_method_dispatch]` on `trait IntoIterator`
159+ // hides this implementation from explicit `.into_iter()` calls on editions < 2021,
160+ // so those calls will still resolve to the slice implementation, by reference.
161+ #[ cfg( not( bootstrap) ) ]
158162#[ stable( feature = "array_into_iter_impl" , since = "1.53.0" ) ]
159163impl < T , const N : usize > IntoIterator for [ T ; N ] {
160164 type Item = T ;
Original file line number Diff line number Diff line change @@ -198,6 +198,7 @@ pub trait FromIterator<A>: Sized {
198198/// }
199199/// ```
200200#[ rustc_diagnostic_item = "IntoIterator" ]
201+ #[ cfg_attr( not( bootstrap) , rustc_skip_array_during_method_dispatch) ]
201202#[ stable( feature = "rust1" , since = "1.0.0" ) ]
202203pub trait IntoIterator {
203204 /// The type of the elements being iterated over.
You can’t perform that action at this time.
0 commit comments