error[E0053]: method `next` has an incompatible type for trait --> $DIR/issue-21332.rs:5:27 | LL | fn next(&mut self) -> Result { Ok(7) } | ^^^^^^^^^^^^^^^^ expected `Option`, found `Result` | = note: expected signature `fn(&mut S) -> Option` found signature `fn(&mut S) -> Result` help: change the output type to match the trait | LL | fn next(&mut self) -> Option { Ok(7) } | ~~~~~~~~~~~ error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0053`.