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 suggestion_source = r#"[1, 2, 3].into_iter().for_each(|n| { *n; });
2648
+
"#;
2649
+
2650
+
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";
2651
+
let long_title2 = "for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>";
2652
+
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
2686
+
--> lint_example.rs:3:11
2687
+
|
2688
+
3 | [1, 2, 3].into_iter().for_each(|n| { *n; });
2689
+
| ^^^^^^^^^
2690
+
|
2691
+
= warning: this changes meaning in Rust 2021
2692
+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
2693
+
= note: `#[warn(array_into_iter)]` on by default
2694
+
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
2695
+
|
2696
+
3 - [1, 2, 3].into_iter().for_each(|n| { *n; });
2697
+
3 + [1, 2, 3].iter().for_each(|n| { *n; });
2698
+
|
2699
+
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
#[should_panic = "Patch span `47..47` is beyond the end of buffer `45`"]
2710
+
fnsuggestion_span_bigger_than_source(){
2711
+
let snippet_source = r#"#![allow(unused)]
2712
+
fn main() {
2713
+
[1, 2, 3].into_iter().for_each(|n| { *n; });
2714
+
}
2715
+
"#;
2716
+
let suggestion_source = r#"[1, 2, 3].into_iter().for_each(|n| { *n; });
2717
+
"#;
2718
+
2719
+
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";
2720
+
let long_title2 = "for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>";
2721
+
let long_title3 = "or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value";
0 commit comments