forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#85682 - m-ou-se:array-into-iter-2, r=nikomats…
…akis Update array_into_iter lint for 1.53 and edition changes. This updates the array_into_iter lint for Rust 1.53 and the edition changes. See rust-lang#84513 r? `@estebank`
- Loading branch information
Showing
8 changed files
with
258 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,54 @@ | ||
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. | ||
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021. | ||
--> $DIR/into-iter-on-arrays-2018.rs:14:34 | ||
| | ||
LL | let _: Iter<'_, i32> = array.into_iter(); | ||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | ||
| ^^^^^^^^^ | ||
| | ||
= note: `#[warn(array_into_iter)]` on by default | ||
= warning: this changes meaning in Rust 2021 | ||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145> | ||
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | ||
| | ||
LL | let _: Iter<'_, i32> = array.iter(); | ||
| ^^^^ | ||
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value | ||
| | ||
LL | let _: Iter<'_, i32> = IntoIterator::into_iter(array); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^ | ||
|
||
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. | ||
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021. | ||
--> $DIR/into-iter-on-arrays-2018.rs:18:44 | ||
| | ||
LL | let _: Iter<'_, i32> = Box::new(array).into_iter(); | ||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | ||
| ^^^^^^^^^ | ||
| | ||
= warning: this changes meaning in Rust 2021 | ||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145> | ||
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | ||
| | ||
LL | let _: Iter<'_, i32> = Box::new(array).iter(); | ||
| ^^^^ | ||
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value | ||
| | ||
LL | let _: Iter<'_, i32> = IntoIterator::into_iter(Box::new(array)); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^ | ||
|
||
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021. | ||
--> $DIR/into-iter-on-arrays-2018.rs:29:24 | ||
| | ||
LL | for _ in [1, 2, 3].into_iter() {} | ||
| ^^^^^^^^^ | ||
| | ||
= warning: this changes meaning in Rust 2021 | ||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145> | ||
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | ||
| | ||
LL | for _ in [1, 2, 3].iter() {} | ||
| ^^^^ | ||
help: or remove `.into_iter()` to iterate by value | ||
| | ||
LL | for _ in [1, 2, 3] {} | ||
| -- | ||
|
||
warning: 2 warnings emitted | ||
warning: 3 warnings emitted | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.