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

16 lines
490 B
Plaintext

error[E0308]: mismatched types
--> $DIR/return-dyn-type-mismatch-2.rs:7:5
|
LL | fn foo<T>() -> dyn Trait<T>
| ------------ expected `(dyn Trait<T> + 'static)` because of return type
...
LL | 42
| ^^ expected `dyn Trait`, found integer
|
= note: expected trait object `(dyn Trait<T> + 'static)`
found type `{integer}`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.