forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#85682 - m-ou-se:array-into-iter-2, r=nikoma…
…tsakis 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
9 changed files
with
237 additions
and
318 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,42 +1,48 @@ | ||
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 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> | ||
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. | ||
--> $DIR/into-iter-on-arrays-2018.rs:18:44 | ||
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:17:44 | ||
| | ||
LL | let _: Iter<'_, i32> = Box::new(array).into_iter(); | ||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | ||
| ^^^^^^^^^ | ||
| | ||
= 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> | ||
|
||
warning: 2 warnings emitted | ||
|
||
Future incompatibility report: Future breakage date: None, diagnostic: | ||
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. | ||
--> $DIR/into-iter-on-arrays-2018.rs:14:34 | ||
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | ||
| | ||
LL | let _: Iter<'_, i32> = array.into_iter(); | ||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | ||
LL | let _: Iter<'_, i32> = Box::new(array).iter(); | ||
| ^^^^ | ||
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value | ||
| | ||
= 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> | ||
LL | let _: Iter<'_, i32> = IntoIterator::into_iter(Box::new(array)); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^ | ||
|
||
Future breakage date: None, diagnostic: | ||
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. | ||
--> $DIR/into-iter-on-arrays-2018.rs:18:44 | ||
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:27:24 | ||
| | ||
LL | let _: Iter<'_, i32> = Box::new(array).into_iter(); | ||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | ||
LL | for _ in [1, 2, 3].into_iter() {} | ||
| ^^^^^^^^^ | ||
| | ||
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | ||
| | ||
= 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> | ||
LL | for _ in [1, 2, 3].iter() {} | ||
| ^^^^ | ||
help: or remove `.into_iter()` to iterate by value | ||
| | ||
LL | for _ in [1, 2, 3] {} | ||
| -- | ||
|
||
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.