Skip to content

Commit fd9af8b

Browse files
Implement BOXED_SLICE_INTO_ITER
1 parent a398018 commit fd9af8b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: core/src/array/iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub struct IntoIter<T, const N: usize> {
3838
alive: IndexRange,
3939
}
4040

41-
// Note: the `#[rustc_skip_array_during_method_dispatch]` on `trait IntoIterator`
41+
// Note: the `#[rustc_skip_during_method_dispatch(array)]` on `trait IntoIterator`
4242
// hides this implementation from explicit `.into_iter()` calls on editions < 2021,
4343
// so those calls will still resolve to the slice implementation, by reference.
4444
#[stable(feature = "array_into_iter_impl", since = "1.53.0")]

Diff for: core/src/iter/traits/collect.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ where
268268
/// }
269269
/// ```
270270
#[rustc_diagnostic_item = "IntoIterator"]
271-
#[rustc_skip_array_during_method_dispatch]
272271
#[rustc_on_unimplemented(
273272
on(
274273
_Self = "core::ops::range::RangeTo<Idx>",
@@ -312,6 +311,8 @@ where
312311
label = "`{Self}` is not an iterator",
313312
message = "`{Self}` is not an iterator"
314313
)]
314+
#[cfg_attr(bootstrap, rustc_skip_array_during_method_dispatch)]
315+
#[cfg_attr(not(bootstrap), rustc_skip_during_method_dispatch(array, boxed_slice))]
315316
#[stable(feature = "rust1", since = "1.0.0")]
316317
pub trait IntoIterator {
317318
/// The type of the elements being iterated over.

0 commit comments

Comments
 (0)