File tree 2 files changed +5
-0
lines changed
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] {
155
155
}
156
156
}
157
157
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) ) ]
158
162
#[ stable( feature = "array_into_iter_impl" , since = "1.53.0" ) ]
159
163
impl < T , const N : usize > IntoIterator for [ T ; N ] {
160
164
type Item = T ;
Original file line number Diff line number Diff line change @@ -198,6 +198,7 @@ pub trait FromIterator<A>: Sized {
198
198
/// }
199
199
/// ```
200
200
#[ rustc_diagnostic_item = "IntoIterator" ]
201
+ #[ cfg_attr( not( bootstrap) , rustc_skip_array_during_method_dispatch) ]
201
202
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
202
203
pub trait IntoIterator {
203
204
/// The type of the elements being iterated over.
You can’t perform that action at this time.
0 commit comments