]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/impl-trait-return-missing-constraint.stderr
feat(rustdoc): open sidebar menu when links inside it are focused
[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 found opaque type
6 ...
7 LL | fn baz() -> impl Bar<Item = i32> {
8    |             ^^^^^^^^^^^^^^^^^^^^ expected `i32`, found associated type
9    |
10    = note:         expected type `i32`
11            found associated type `<impl Bar as Foo>::Item`
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`.