pub struct Handle<T> {
data: T,
}
impl<S: From<T>, T> From<Handle<T>> for Handle<S> {
fn from(value: Handle<T>) -> Self {
Self {
data: value.data.into(),
}
}
}
Errors:
Compiling playground v0.0.1 (/playground)
error[E0119]: conflicting implementations of trait `From<Handle<_>>` for type `Handle<_>`
--> src/lib.rs:5:1
|
5 | impl<S: From<T>, T> From<Handle<T>> for Handle<S> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `core`:
- impl<T> From<T> for T;
For more information about this error, try `rustc --explain E0119`.
error: could not compile `playground` (lib) due to 1 previous error