You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling chrono v0.4.5(file:///mnt/d/rand/chrono)
error[E0119]: conflicting implementations of trait `std::convert::From<datetime::DateTime<_>>` for type `datetime::DateTime<_>`:
--> src/datetime.rs:238:1
|
238 | impl<Src:TimeZone,Dst:TimeZone>From<DateTime<Src>>forDateTime<Dst>{
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation incrate `core`:
- impl<T> std::convert::From<T> forT;
error: aborting due to previous error
For more information about this error, try `rustc --explain E0119`.
error:Could not compile `chrono`.To learn more, run the command again with --verbose.Makefile:17: recipe for target 'build' failed
make:***[build]Error101
Could the generic impl be made more specific so that it accounts for the fact that Foo<T1> and Foo<T2> are not the same, to permit user-defined conversion between them?
The text was updated successfully, but these errors were encountered:
The blanket
impl From<T> for T
definition in core makes actual impls ofstd::convert::From
for generic types extremely difficult.Consider:
It is natural to wish to implement conversion between the subtypes, and to want to do so with as little repetition as possible. But
is not possible:
Could the generic impl be made more specific so that it accounts for the fact that
Foo<T1>
andFoo<T2>
are not the same, to permit user-defined conversion between them?The text was updated successfully, but these errors were encountered: