Closed
Description
Currently uses of <[_; _] as _>::into_iter()
emit a future compat warning:
warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
--> src/main.rs:2:23
|
2 | let _ = [1, 2, 3].into_iter();
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
= note: `#[warn(array_into_iter)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
but at some point this will cause ambiguity errors on 2015 and 2018 editions. On 2021 onwards, this case is handled by a special attribute and keeps the code compiling.
We should detect that case explicitly and provide guidance about what to write in the current edition, or to update to the new edition.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: The 2021 editionDiagnostics: An error or lint that should account for edition differences.Low priorityRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.