rust/tests/ui/typeck/return-dyn-type-mismatch.st...

16 lines
635 B
Plaintext

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