summaryrefslogtreecommitdiffstats
path: root/tests/ui/typeck/return-dyn-type-mismatch-2.stderr
blob: 77299621ab91eb9d32230423cea36570fcbc5e74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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`.