about summary refs log tree commit diff
path: root/library/core/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-04-17 16:32:17 -0400
committerMichael Goulet <michael@errs.io>2024-05-20 19:21:30 -0400
commita502e7ac1d7d117daea302717c012edf3243f361 (patch)
treee62bfa14c553fb1d876f4acae2593a9d22273c13 /library/core/src
parent1a8109253196064e26a427d9184874ae14c55f6e (diff)
downloadrust-a502e7ac1d7d117daea302717c012edf3243f361.tar.gz
rust-a502e7ac1d7d117daea302717c012edf3243f361.zip
Implement BOXED_SLICE_INTO_ITER
Diffstat (limited to 'library/core/src')
-rw-r--r--library/core/src/array/iter.rs2
-rw-r--r--library/core/src/iter/traits/collect.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs
index e3d2cd2a31f..b314d0536a3 100644
--- a/library/core/src/array/iter.rs
+++ b/library/core/src/array/iter.rs
@@ -38,7 +38,7 @@ pub struct IntoIter<T, const N: usize> {
     alive: IndexRange,
 }
 
-// Note: the `#[rustc_skip_array_during_method_dispatch]` on `trait IntoIterator`
+// Note: the `#[rustc_skip_during_method_dispatch(array)]` 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.
 #[stable(feature = "array_into_iter_impl", since = "1.53.0")]
diff --git a/library/core/src/iter/traits/collect.rs b/library/core/src/iter/traits/collect.rs
index 563781230c0..d9d860c7b6c 100644
--- a/library/core/src/iter/traits/collect.rs
+++ b/library/core/src/iter/traits/collect.rs
@@ -268,7 +268,6 @@ where
 /// }
 /// ```
 #[rustc_diagnostic_item = "IntoIterator"]
-#[rustc_skip_array_during_method_dispatch]
 #[rustc_on_unimplemented(
     on(
         _Self = "core::ops::range::RangeTo<Idx>",
@@ -312,6 +311,8 @@ where
     label = "`{Self}` is not an iterator",
     message = "`{Self}` is not an iterator"
 )]
+#[cfg_attr(bootstrap, rustc_skip_array_during_method_dispatch)]
+#[cfg_attr(not(bootstrap), rustc_skip_during_method_dispatch(array, boxed_slice))]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait IntoIterator {
     /// The type of the elements being iterated over.