Open
Description
Consider the following code, close to the one in #50237:
#![crate_type="lib"]
use std::marker::PhantomData;
trait Foo {
type Type: Qux<Self>;
}
struct Bar<T>(PhantomData<T>);
trait Qux<T> {}
impl<T: Foo<Type=U>, U: Qux<T>> From<U> for Bar<T> {
fn from(t: U) -> Self {
Bar(PhantomData)
}
}
This fails to build with:
error[E0119]: conflicting implementations of trait `std::convert::From<Bar<_>>` for type `Bar<_>`:
--> src/lib.rs:13:1
|
13 | impl<T: Foo<Type=U>, U: Qux<T>> From<U> for Bar<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `core`:
- impl<T> std::convert::From<T> for T;
= note: downstream crates may implement trait `Qux<_>` for type `Bar<_>`
But how can a downstream crate implement Qux<_>
for Bar<_>
?