2021-09-01 22:07:56 -05:00
|
|
|
fn main() {
|
|
|
|
let v = vec![1i32, 2, 3];
|
|
|
|
for _ in v[1..] {
|
|
|
|
//~^ ERROR [i32]` is not an iterator [E0277]
|
|
|
|
//~^^ ERROR known at compilation time
|
|
|
|
}
|
2021-09-07 02:49:43 -05:00
|
|
|
struct K {
|
|
|
|
n: i32,
|
|
|
|
}
|
|
|
|
let mut v2 = vec![K { n: 1 }, K { n: 1 }, K { n: 1 }];
|
|
|
|
for i2 in v2[1..] {
|
|
|
|
//~^ ERROR [K]` is not an iterator [E0277]
|
|
|
|
//~^^ ERROR known at compilation time
|
|
|
|
i2.n = 2;
|
|
|
|
}
|
2021-09-01 22:07:56 -05:00
|
|
|
}
|