error[E0308]: mismatched types --> $DIR/restrict-assoc-type-of-generic-bound.rs:9:12 | LL | pub fn foo(a: A) -> B { | - - expected `B` because of return type | | | expected this type parameter LL | return a.bar(); | ^^^^^^^ expected type parameter `B`, found associated type | = note: expected type parameter `B` found associated type `::T` = note: the caller chooses a type for `B` which can be different from `::T` help: consider further restricting this bound | LL | pub fn foo, B>(a: A) -> B { | +++++++ error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0308`.