Compiling playground v0.0.1 (/playground)
error[E0119]: conflicting implementations of trait `std::convert::Into<_>` for type `Wrapper<_>`
--> src/lib.rs:3:1
|
3 | impl<T> Into<T> for Wrapper<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `core`:
- impl<T, U> Into<U> for T
where U: From<T>;
For more information about this error, try `rustc --explain E0119`.
error: could not compile `playground` due to previous error
IIUC this blanket impl is only valid if U: From<T> - in this case, it would be T: From<Wrapper<T>>, but since this bound isn't implemented, why is there a conflict?
It's not enough for the compiler to consider what traits are currently implemented – it has to consider what traits are possible to implement. Otherwise, the mere addition of a trait would be a breaking change, which is undesirable. You are only allowed to create impls which are impossible to create otherwise – this is why there are seemingly funny rules around ordering of type parameters in generic impls.