error[E0277]: the trait bound `Struct: Foo<i32>` is not satisfied --> $DIR/highlight-difference-between-expected-trait-and-found-trait.rs:15:13 | LL | fn foo() -> impl Foo<i32> { | ^^^^^^^^^^^^^ unsatisfied trait bound LL | Struct | ------ return type was inferred to be `Struct` here | = help: the trait `Bar<i32>` is not implemented for `Struct` but trait `Bar<()>` is implemented for it = help: for that trait implementation, expected `()`, found `i32` note: required for `Struct` to implement `Foo<i32>` --> $DIR/highlight-difference-between-expected-trait-and-found-trait.rs:10:12 | LL | impl<T, K> Foo<K> for T where T: Bar<K> | ^^^^^^ ^ ------ unsatisfied trait bound introduced here error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0277`.