]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/impl-trait-return-missing-constraint.stderr
Rollup merge of #76468 - SNCPlay42:lifetime-names, r=Mark-Simulacrum
[rust.git] / src / test / ui / associated-types / impl-trait-return-missing-constraint.stderr
1 error[E0271]: type mismatch resolving `<impl Bar as Foo>::Item == i32`
2   --> $DIR/impl-trait-return-missing-constraint.rs:25:13
3    |
4 LL | fn bar() -> impl Bar {
5    |             -------- the expected opaque type
6 ...
7 LL | fn baz() -> impl Bar<Item = i32> {
8    |             ^^^^^^^^^^^^^^^^^^^^ expected associated type, found `i32`
9    |
10    = note: expected associated type `<impl Bar as Foo>::Item`
11                          found type `i32`
12 help: consider constraining the associated type `<impl Bar as Foo>::Item` to `i32`
13    |
14 LL | fn bar() -> impl Bar<Item = i32> {
15    |                     ^^^^^^^^^^^^
16
17 error: aborting due to previous error
18
19 For more information about this error, try `rustc --explain E0271`.