rust/tests/ui/trait-bounds/restrict-assoc-type-of-gene...

12 lines
189 B
Rust

//@ run-rustfix
pub trait MyTrait {
type T;
fn bar(self) -> Self::T;
}
pub fn foo<A: MyTrait<T = B>, B>(a: A) -> B {
return a.bar(); //~ ERROR mismatched types
}
fn main() {}