Open zakarumych opened 1 month ago
Note that IntoIterator::into_iter(array)
works on all editions (since Rust 1.53.0). Regardless, new
will not be removed within the Rust 1.X era, so users can just #[allow(deprecated)]
on their uses of this if they need to support specifically Rust version 1.52.0 or 1.51.0 and newer versions where new
is deprecated, with no warnings (or if they don't need to support old Rust versions, change to using Edition 2021(+) and use array.into_iter()
).
I agree with all suggested fixes. The only problem is error message. Maybe simply mention this caveat?
Code
Current output
Desired output
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
Anything else?
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f15a8e22d23c8b20ed3a21c6f3b4ab01