mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Update tests for updated array_into_iter lint.
This commit is contained in:
parent
5cfe2a5fc6
commit
aec2c5b2b6
@ -12,11 +12,11 @@ fn main() {
|
|||||||
// Before 2021, the method dispatched to `IntoIterator for &[T; N]`,
|
// Before 2021, the method dispatched to `IntoIterator for &[T; N]`,
|
||||||
// which we continue to support for compatibility.
|
// which we continue to support for compatibility.
|
||||||
let _: Iter<'_, i32> = array.into_iter();
|
let _: Iter<'_, i32> = array.into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
|
|
||||||
let _: Iter<'_, i32> = Box::new(array).into_iter();
|
let _: Iter<'_, i32> = Box::new(array).into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
|
|
||||||
// The `array_into_iter` lint doesn't cover other wrappers that deref to an array.
|
// The `array_into_iter` lint doesn't cover other wrappers that deref to an array.
|
||||||
|
@ -1,21 +1,37 @@
|
|||||||
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
|
--> $DIR/into-iter-on-arrays-2018.rs:14:34
|
||||||
|
|
|
|
||||||
LL | let _: Iter<'_, i32> = array.into_iter();
|
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
|
= note: `#[warn(array_into_iter)]` on by default
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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
|
--> $DIR/into-iter-on-arrays-2018.rs:18:44
|
||||||
|
|
|
|
||||||
LL | let _: Iter<'_, i32> = Box::new(array).into_iter();
|
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
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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: 2 warnings emitted
|
warning: 2 warnings emitted
|
||||||
|
|
||||||
|
@ -7,42 +7,42 @@ fn main() {
|
|||||||
|
|
||||||
// Expressions that should trigger the lint
|
// Expressions that should trigger the lint
|
||||||
small.iter();
|
small.iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
[1, 2].iter();
|
[1, 2].iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
big.iter();
|
big.iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
[0u8; 33].iter();
|
[0u8; 33].iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
|
|
||||||
Box::new(small).iter();
|
Box::new(small).iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new([1, 2]).iter();
|
Box::new([1, 2]).iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new(big).iter();
|
Box::new(big).iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new([0u8; 33]).iter();
|
Box::new([0u8; 33]).iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
|
|
||||||
Box::new(Box::new(small)).iter();
|
Box::new(Box::new(small)).iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new(Box::new([1, 2])).iter();
|
Box::new(Box::new([1, 2])).iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new(Box::new(big)).iter();
|
Box::new(Box::new(big)).iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new(Box::new([0u8; 33])).iter();
|
Box::new(Box::new([0u8; 33])).iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
|
|
||||||
// Expressions that should not
|
// Expressions that should not
|
||||||
|
@ -7,42 +7,42 @@ fn main() {
|
|||||||
|
|
||||||
// Expressions that should trigger the lint
|
// Expressions that should trigger the lint
|
||||||
small.into_iter();
|
small.into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
[1, 2].into_iter();
|
[1, 2].into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
big.into_iter();
|
big.into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
[0u8; 33].into_iter();
|
[0u8; 33].into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
|
|
||||||
Box::new(small).into_iter();
|
Box::new(small).into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new([1, 2]).into_iter();
|
Box::new([1, 2]).into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new(big).into_iter();
|
Box::new(big).into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new([0u8; 33]).into_iter();
|
Box::new([0u8; 33]).into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
|
|
||||||
Box::new(Box::new(small)).into_iter();
|
Box::new(Box::new(small)).into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new(Box::new([1, 2])).into_iter();
|
Box::new(Box::new([1, 2])).into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new(Box::new(big)).into_iter();
|
Box::new(Box::new(big)).into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
Box::new(Box::new([0u8; 33])).into_iter();
|
Box::new(Box::new([0u8; 33])).into_iter();
|
||||||
//~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
|
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
|
||||||
//~| WARNING this changes meaning
|
//~| WARNING this changes meaning
|
||||||
|
|
||||||
// Expressions that should not
|
// Expressions that should not
|
||||||
|
@ -1,111 +1,207 @@
|
|||||||
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-lint.rs:9:11
|
--> $DIR/into-iter-on-arrays-lint.rs:9:11
|
||||||
|
|
|
|
||||||
LL | small.into_iter();
|
LL | small.into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= note: `#[warn(array_into_iter)]` on by default
|
= note: `#[warn(array_into_iter)]` on by default
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | small.iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter(small);
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
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-lint.rs:12:12
|
--> $DIR/into-iter-on-arrays-lint.rs:12:12
|
||||||
|
|
|
|
||||||
LL | [1, 2].into_iter();
|
LL | [1, 2].into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | [1, 2].iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter([1, 2]);
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
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-lint.rs:15:9
|
--> $DIR/into-iter-on-arrays-lint.rs:15:9
|
||||||
|
|
|
|
||||||
LL | big.into_iter();
|
LL | big.into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | big.iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter(big);
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
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-lint.rs:18:15
|
--> $DIR/into-iter-on-arrays-lint.rs:18:15
|
||||||
|
|
|
|
||||||
LL | [0u8; 33].into_iter();
|
LL | [0u8; 33].into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | [0u8; 33].iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter([0u8; 33]);
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
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-lint.rs:22:21
|
--> $DIR/into-iter-on-arrays-lint.rs:22:21
|
||||||
|
|
|
|
||||||
LL | Box::new(small).into_iter();
|
LL | Box::new(small).into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | Box::new(small).iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter(Box::new(small));
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
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-lint.rs:25:22
|
--> $DIR/into-iter-on-arrays-lint.rs:25:22
|
||||||
|
|
|
|
||||||
LL | Box::new([1, 2]).into_iter();
|
LL | Box::new([1, 2]).into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | Box::new([1, 2]).iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter(Box::new([1, 2]));
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
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-lint.rs:28:19
|
--> $DIR/into-iter-on-arrays-lint.rs:28:19
|
||||||
|
|
|
|
||||||
LL | Box::new(big).into_iter();
|
LL | Box::new(big).into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | Box::new(big).iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter(Box::new(big));
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
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-lint.rs:31:25
|
--> $DIR/into-iter-on-arrays-lint.rs:31:25
|
||||||
|
|
|
|
||||||
LL | Box::new([0u8; 33]).into_iter();
|
LL | Box::new([0u8; 33]).into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | Box::new([0u8; 33]).iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter(Box::new([0u8; 33]));
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
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-lint.rs:35:31
|
--> $DIR/into-iter-on-arrays-lint.rs:35:31
|
||||||
|
|
|
|
||||||
LL | Box::new(Box::new(small)).into_iter();
|
LL | Box::new(Box::new(small)).into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | Box::new(Box::new(small)).iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter(Box::new(Box::new(small)));
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
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-lint.rs:38:32
|
--> $DIR/into-iter-on-arrays-lint.rs:38:32
|
||||||
|
|
|
|
||||||
LL | Box::new(Box::new([1, 2])).into_iter();
|
LL | Box::new(Box::new([1, 2])).into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | Box::new(Box::new([1, 2])).iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter(Box::new(Box::new([1, 2])));
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
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-lint.rs:41:29
|
--> $DIR/into-iter-on-arrays-lint.rs:41:29
|
||||||
|
|
|
|
||||||
LL | Box::new(Box::new(big)).into_iter();
|
LL | Box::new(Box::new(big)).into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | Box::new(Box::new(big)).iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter(Box::new(Box::new(big)));
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
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-lint.rs:44:35
|
--> $DIR/into-iter-on-arrays-lint.rs:44:35
|
||||||
|
|
|
|
||||||
LL | Box::new(Box::new([0u8; 33])).into_iter();
|
LL | Box::new(Box::new([0u8; 33])).into_iter();
|
||||||
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this changes meaning in Rust 2021
|
= warning: this changes meaning in Rust 2021
|
||||||
= note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
|
= 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 | Box::new(Box::new([0u8; 33])).iter();
|
||||||
|
| ^^^^
|
||||||
|
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
|
||||||
|
LL | IntoIterator::into_iter(Box::new(Box::new([0u8; 33])));
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
|
||||||
|
|
||||||
warning: 12 warnings emitted
|
warning: 12 warnings emitted
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user