struct Foo {} impl Foo { fn to_bar(&self, maybe: bool) -> Option> { maybe.then(|| Box::new(0usize)) } } impl Bar for usize {} trait Bar {} This is the kind of thing that I'd usually expect to work, but it fails: rror[E0308]: mismatched types --> src/lib.rs:5:9 | 4 | fn to_bar(&self, maybe: bool) -> Option> { | -------------------- expected `Option>` because of return type 5 | ...| Rust Internals