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
In previous (post-1.0) versions of the compiler, the latter was able to be implemented, however, now it's seen as conflicting with impl<T, U> Into<U> for T where U: From<T>, which is definitely the correct behaviour.
But right now, not being able to implement From for this case seems very much to me like a bug.
The text was updated successfully, but these errors were encountered:
clarfonthey
changed the title
Can't implement From or Into for custom type
Can't implement From or Into for custom wrapper type
Apr 9, 2018
The coherence issue with implementing From is that a downstream crate might want to implement From<Wrapper<TheirType>> for TheirType and they get priority.
This won't work:
and neither will:
In previous (post-1.0) versions of the compiler, the latter was able to be implemented, however, now it's seen as conflicting with
impl<T, U> Into<U> for T where U: From<T>
, which is definitely the correct behaviour.But right now, not being able to implement
From
for this case seems very much to me like a bug.The text was updated successfully, but these errors were encountered: