rust-lang / rust-lang/rust

array::IntoIter::new deprecation warning suggestion may lead to compilation error on 2015 and 2018 editions

Open
#127,983 2 comments 0 reactions 0 assignees View on GitHub

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?

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f15a8e22d23c8b20ed3a21c6f3b4ab01

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.