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
Copy file name to clipboardExpand all lines: tests/formatter.rs
+2-21Lines changed: 2 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -2706,6 +2706,7 @@ help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicit
2706
2706
}
2707
2707
2708
2708
#[test]
2709
+
#[should_panic = "Patch span `47..47` is beyond the end of buffer `45`"]
2709
2710
fnsuggestion_span_bigger_than_source(){
2710
2711
let snippet_source = r#"#![allow(unused)]
2711
2712
fn main() {
@@ -2749,26 +2750,6 @@ fn main() {
2749
2750
),
2750
2751
];
2751
2752
2752
-
let expected = str![[r#"
2753
-
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
2754
-
--> lint_example.rs:3:11
2755
-
|
2756
-
3 | [1, 2, 3].into_iter().for_each(|n| { *n; });
2757
-
| ^^^^^^^^^
2758
-
|
2759
-
= warning: this changes meaning in Rust 2021
2760
-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
2761
-
= note: `#[warn(array_into_iter)]` on by default
2762
-
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
2763
-
|
2764
-
3 - [1, 2, 3].into_iter().for_each(|n| { *n; });
2765
-
3 + [1, 2, 3].iter().for_each(|n| { *n; });
2766
-
|
2767
-
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
0 commit comments