2015-07-18 21:14:36 -04:00
|
|
|
struct S;
|
|
|
|
|
|
|
|
|
|
impl Iterator for S {
|
|
|
|
|
type Item = i32;
|
|
|
|
|
fn next(&mut self) -> Result<i32, i32> { Ok(7) }
|
|
|
|
|
//~^ ERROR method `next` has an incompatible type for trait
|
2023-01-02 18:00:33 -08:00
|
|
|
//~| expected `Option<i32>`, found `Result<i32, i32>`
|
2015-07-18 21:14:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|