From 3dab4e22d43c1ec724b23d301c81bdc2b99d50e7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 12 Apr 2021 16:07:28 -0700 Subject: Skip into_iter() for arrays before 2021 --- library/core/src/array/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'library/core/src/array') 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 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 IntoIterator for [T; N] { type Item = T; -- cgit 1.4.1-3-g733a5