about summary refs log tree commit diff
path: root/tests/ui/issues/issue-21332.rs
blob: ad764f84aa81a256e903324338f3db7075226d11 (plain)
1
2
3
4
5
6
7
8
9
10
11
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
    //~| NOTE expected `Option<i32>`, found `Result<i32, i32>`
    //~| NOTE expected signature `fn(&mut S) -> Option<i32>`
}

fn main() {}