diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-21332.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-21332.rs b/src/test/ui/issues/issue-21332.rs new file mode 100644 index 000000000..6547f3a9b --- /dev/null +++ b/src/test/ui/issues/issue-21332.rs @@ -0,0 +1,10 @@ +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 + //~| expected enum `Option`, found enum `Result` +} + +fn main() {} |