1 error[E0271]: type mismatch resolving `<impl Bar as Foo>::Item == i32`
2 --> $DIR/impl-trait-return-missing-constraint.rs:25:13
4 LL | fn bar() -> impl Bar {
5 | -------- the expected opaque type
7 LL | fn baz() -> impl Bar<Item = i32> {
8 | ^^^^^^^^^^^^^^^^^^^^ expected associated type, found `i32`
11 | ----- return type was inferred to be `impl Bar` here
13 = note: expected associated type `<impl Bar as Foo>::Item`
15 = help: consider constraining the associated type `<impl Bar as Foo>::Item` to `i32` or calling a method that returns `<impl Bar as Foo>::Item`
16 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
17 help: consider constraining the associated type `<impl Bar as Foo>::Item` to `i32`
19 LL | fn bar() -> impl Bar<Item = i32> {
22 error: aborting due to previous error
24 For more information about this error, try `rustc --explain E0271`.