-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-trait-systemArea: Trait systemArea: Trait systemA-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
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
".
Rufflewind, Limeth, mikebenfield, p4l1ly, Ploppz and 47 moredzmitry-lahoda, benluelo and BenjaminBrienen
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemA-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.