Add a test for #398

This commit is contained in:
mcarton 2016-01-14 21:04:34 +01:00
parent 387e0991e3
commit e6b905d925

View file

@ -32,6 +32,11 @@ fn main() {
println!("{} {}", vec[i], vec2[i]);
}
for i in 0..vec.len() {
//~^ ERROR `i` is only used to index `vec2`. Consider using `for item in vec2.iter().take(vec.len())`
println!("{}", vec2[i]);
}
for i in 5..vec.len() {
//~^ ERROR `i` is only used to index `vec`. Consider using `for item in vec.iter().skip(5)`
println!("{}", vec[i]);