Auto merge of #5798 - mikerite:fix-2277-2, r=yaahc

Add test for `needless_range_loop` issue

Closes #2277

This was fixed when we fixed #2542.

changelog: none
This commit is contained in:
bors 2020-07-14 17:23:31 +00:00
commit 84cdce01cb

View file

@ -83,3 +83,13 @@ fn main() {
println!("{}", arr[i]);
}
}
mod issue2277 {
pub fn example(list: &[[f64; 3]]) {
let mut x: [f64; 3] = [10.; 3];
for i in 0..3 {
x[i] = list.iter().map(|item| item[i]).sum::<f64>();
}
}
}