WIP: IntoIterator for Box<[T]> + method dispatch mitigation for editions < 2024 by clarfonthey · Pull Request #116607 · rust-lang/rust
rustbot
added
S-waiting-on-review
labels
Oct 10, 2023
clarfonthey
changed the title
[NEEDS CRATER] IntoIterator for Box<[T]>
IntoIterator for Box<[T]>
bors added a commit to rust-lang-ci/rust that referenced this pull request
Oct 11, 2023IntoIterator for Box<[T]> ACP: rust-lang/libs-team#263 Recommendation per ACP: this should receive a crater run to gauge impact. If there's no impact, it can be merged as-is, but otherwise it will need a similar edition-based workaround to the array implementation. In addition to what was proposed by the ACP, this also adds `IntoIterator for &Box<[T]>` and `IntoIterator for &mut Box<[T]>` to ensure that those work as expected. I also already had to change at least one line in the compiler to account for this change, which isn't a good sign toward whether edition-specific mitigations may be needed, but we'll see.
clarfonthey
changed the title
IntoIterator for Box<[T]>
WIP: IntoIterator for Box<[T]>
clarfonthey
changed the title
WIP: IntoIterator for Box<[T]>
WIP: IntoIterator for Box<[T]> + method dispatch mitigation for editions < 2024
tmandry
added
T-libs-api
and removed T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue. Relevant to the library team, which will review and decide on the PR/issue.labels
Apr 17, 2024This was referenced
Apr 17, 2024bors added a commit to rust-lang-ci/rust that referenced this pull request
Apr 18, 2024…=<try> [crate] Add `Box<[T; N]>: IntoIterator` without any method dispatch hacks **Unlike** `Box<[T]>` (rust-lang#116607 (comment)), there's a much higher chance that this will not conflict with existing usages since it produces an iterator with the same type before/after this change, but let's test that theory with crater. Ideally we have fewer migrations that are tangled up in hacks like `rustc_skip_during_method_dispatch`, so if this crater comes back clean, I'd strongly suggest landing this as-is. As for the rationale for having this impl at all, I agree (as `@clarfonthey` pointed out in rust-lang#124097 (comment)) that it is generally better for any user to not require moving the array *out* of the box just to turn it into an iterator.
bors added a commit to rust-lang-ci/rust that referenced this pull request
May 21, 2024…fleLapkin 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 rust-lang#116607. ACP: rust-lang/libs-team#263 References rust-lang#59878 Tracking for Rust 2024: rust-lang#123759 Crater run was done here: rust-lang#116607 (comment) Consensus afaict was that there is too much breakage, so let's do this in an edition-dependent way much like `[T; N]: IntoIterator`.
RalfJung pushed a commit to RalfJung/miri that referenced this pull request
May 22, 2024Add `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: rust-lang/rust#123759 Crater run was done here: rust-lang/rust#116607 (comment) Consensus afaict was that there is too much breakage, so let's do this in an edition-dependent way much like `[T; N]: IntoIterator`.
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request
May 24, 2024Add `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: rust-lang/rust#123759 Crater run was done here: rust-lang/rust#116607 (comment) Consensus afaict was that there is too much breakage, so let's do this in an edition-dependent way much like `[T; N]: IntoIterator`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters