-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
exploration: ignoring arrays in method dispatch #84133
Copy link
Copy link
Closed
Labels
A-maybe-future-editionSomething we may consider for a future edition.Something we may consider for a future edition.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-maybe-future-editionSomething we may consider for a future edition.Something we may consider for a future edition.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
In #65819, we are considering adding an impl of
IntoIteratorfor[T; N]for allN. However, this breaks existing code that relies on method dispatch:In this code,
array.into_iter()winds up unsizing to a slice and hence resolving to<&[bool] as IntoIterator>::into_iter(and thus executing on refs to booleans). This issue describes a possible modification to older Rust editions that would allow us to add the impl without breaking existing code or compromising our edition guarantees.