]> git.lizzy.rs Git - rust.git/blob - src/test/ui/for/for-loop-bogosity.rs
Rollup merge of #100396 - chenyukang:fix-100394, r=petrochenkov
[rust.git] / src / test / ui / for / for-loop-bogosity.rs
1 struct MyStruct {
2     x: isize,
3     y: isize,
4 }
5
6 impl MyStruct {
7     fn next(&mut self) -> Option<isize> {
8         Some(self.x)
9     }
10 }
11
12 pub fn main() {
13     let mut bogus = MyStruct {
14         x: 1,
15         y: 2,
16     };
17     for x in bogus {
18     //~^ ERROR `MyStruct` is not an iterator
19         drop(x);
20     }
21 }