array::IntoIter::new deprecation warning suggestion may lead to compilation error on 2015 and 2018 editions
Open
Nobody has claimed this yet.
A-diagnostics
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
std::array::IntoIter::new(array)
Current output
warning: use of deprecated associated function `std::array::IntoIter::<T, N>::new`: use `IntoIterator::into_iter` instead
Desired output
No warning on editions 2015 and 2018
Rationale and extra context
In many cases array.into_iter() will use <&[T; N] as IntoIterator>::into_iter on editions 2015 and 2018.
Other cases
No response
Rust Version
rustc 1.79.0 (129f3b996 2024-06-10)
binary: rustc
commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081
commit-date: 2024-06-10
host: x86_64-pc-windows-msvc
release: 1.79.0
LLVM version: 18.1.7
Anything else?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the warning in the linked Rust Playground using the 2015 and 2018 editions and the reported rustc version. Trace the deprecation suggestion for std::array::IntoIter::new and verify that the suggested replacement does not produce a compilation error in those editions; done means the warning or suggestion is corrected without breaking compilation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100