Add test for needless_range_loop issue

Closes #2277

This was fixed when we fixed #2542.
This commit is contained in:
Michael Wright 2020-07-14 08:18:15 +02:00
parent 4b8700879c
commit d067d0352b

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>();
}
}
}