error[E0308]: mismatched types --> $DIR/return-dyn-type-mismatch.rs:15:21 | LL | fn other_func() -> dyn TestTrait { | ------------------------- expected `(dyn TestTrait + 'static)` because of return type LL | match Self::func() { LL | None => None, | ^^^^ expected `dyn TestTrait`, found `Option<_>` | = note: expected trait object `(dyn TestTrait + 'static)` found enum `Option<_>` error: aborting due to previous error For more information about this error, try `rustc --explain E0308`.