Associated types bounds seem to be ignored in generic impls #50237
Labels
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
Consider the following code:
This fails to build with:
This implies the compiler thinks
T::Type
might beBar<T>
, but because of theQux
bound, and the fact that there is noimpl<T> Qux for Bar<T> {}
, it's not possible.In fact, doing some handholding works:
impl<T: Foo<Type=U>, U: Qux> From<U> for Bar<T>
yields no error and is equivalent, albeit unnecessarily verbose.The text was updated successfully, but these errors were encountered: