Skip to content

Commit 84cdce0

Browse files
committed
Auto merge of rust-lang#5798 - mikerite:fix-2277-2, r=yaahc
Add test for `needless_range_loop` issue Closes rust-lang#2277 This was fixed when we fixed rust-lang#2542. changelog: none
2 parents 128c5de + d067d03 commit 84cdce0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/ui/needless_range_loop2.rs

+10
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,13 @@ fn main() {
8383
println!("{}", arr[i]);
8484
}
8585
}
86+
87+
mod issue2277 {
88+
pub fn example(list: &[[f64; 3]]) {
89+
let mut x: [f64; 3] = [10.; 3];
90+
91+
for i in 0..3 {
92+
x[i] = list.iter().map(|item| item[i]).sum::<f64>();
93+
}
94+
}
95+
}

0 commit comments

Comments
 (0)