Open
Description
The following example:
trait Foo<T> {
fn foo(&self) -> &T;
}
trait Bar<A> where A: Foo<Self> {}
fn foobar<A, B: Bar<A>>(a: &A) -> &B {
a.foo()
}
fails with "error: type &A
does not implement any method in scope named foo
".
This UFCS variant
trait Foo<T> {
fn foo(&self) -> &T;
}
trait Bar<A> where A: Foo<Self> {}
fn foobar<A, B: Bar<A>>(a: &A) -> &B {
Foo::foo(a)
}
fails with "error: the trait Foo<_>
is not implemented for the type A
".