struct S; impl Iterator for S { type Item = i32; fn next(&mut self) -> Result { Ok(7) } //~^ ERROR method `next` has an incompatible type for trait //~| NOTE expected `Option`, found `Result` //~| NOTE expected signature `fn(&mut S) -> Option` } fn main() {}