about summary refs log tree commit diff
path: root/library/core/src/array
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-21 10:13:53 +0000
committerbors <bors@rust-lang.org>2024-05-21 10:13:53 +0000
commite8fbd991287f637f95016a71ddc13438415bbe59 (patch)
tree963b2346831db94fadb9b3111d65649575e0c57f /library/core/src/array
parente8753914580fb42554a79a4b5c5fb4cc98933231 (diff)
parent917bb8396cfae8e040e547445a2a6d9cdbd83475 (diff)
downloadrust-e8fbd991287f637f95016a71ddc13438415bbe59.tar.gz
rust-e8fbd991287f637f95016a71ddc13438415bbe59.zip
Auto merge of #124097 - compiler-errors:box-into-iter, r=WaffleLapkin
Add `IntoIterator` for `Box<[T]>` + edition 2024-specific lints

* Adds a similar method probe opt-out mechanism to the `[T;N]: IntoIterator` implementation for edition 2021.
* Adjusts the relevant lints (shadowed `.into_iter()` calls, new source of method ambiguity).
* Adds some tests.
* Took the liberty to rework the logic in the `ARRAY_INTO_ITER` lint, since it was kind of confusing.

Based mostly off of #116607.

ACP: rust-lang/libs-team#263
References #59878
Tracking for Rust 2024: https://github.com/rust-lang/rust/issues/123759

Crater run was done here: https://github.com/rust-lang/rust/pull/116607#issuecomment-1770293013
Consensus afaict was that there is too much breakage, so let's do this in an edition-dependent way much like `[T; N]: IntoIterator`.
Diffstat (limited to 'library/core/src/array')
-rw-r--r--library/core/src/array/iter.rs2
1 files changed, 1 insertions, 1 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")]