diff options
| author | Josh Stone <jistone@redhat.com> | 2021-04-12 16:07:28 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2021-04-16 11:12:01 -0700 |
| commit | 3dab4e22d43c1ec724b23d301c81bdc2b99d50e7 (patch) | |
| tree | 28f83332951c330c70a497df43db18d30616d5fc /library/core/src/array | |
| parent | 35b1590223b44a7da28c584c97967cc63f3e4e25 (diff) | |
| download | rust-3dab4e22d43c1ec724b23d301c81bdc2b99d50e7.tar.gz rust-3dab4e22d43c1ec724b23d301c81bdc2b99d50e7.zip | |
Skip into_iter() for arrays before 2021
Diffstat (limited to 'library/core/src/array')
| -rw-r--r-- | library/core/src/array/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index bd6f35edfac..ddbdc6a4acf 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -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; |
