You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let source2 = r#"[1, 2, 3].into_iter().for_each(|n| { *n; });
2976
+
"#;
2977
+
2978
+
let long_title1 ="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";
2979
+
let long_title2 = "for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>";
2980
+
let long_title3 = "or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value";
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
3024
+
--> lint_example.rs:3:11
3025
+
|
3026
+
3 | [1, 2, 3].into_iter().for_each(|n| { *n; });
3027
+
| ^^^^^^^^^
3028
+
|
3029
+
= warning: this changes meaning in Rust 2021
3030
+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
3031
+
= note: `#[warn(array_into_iter)]` on by default
3032
+
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
3033
+
|
3034
+
3 - [1, 2, 3].into_iter().for_each(|n| { *n; });
3035
+
3 + [1, 2, 3].iter().for_each(|n| { *n; });
3036
+
|
3037
+
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
0 commit comments