1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
struct MyStruct { x: isize, y: isize, } impl MyStruct { fn next(&mut self) -> Option<isize> { Some(self.x) } } pub fn main() { let mut bogus = MyStruct { x: 1, y: 2, }; for x in bogus { //~^ ERROR `MyStruct` is not an iterator drop(x); } }