Open scottmcm opened 5 years ago
I can do impl<T> From<T> for NewType<T>, but I can't do impl<T> From<NewType<T>> for T even though I can do impl From<NewType<u32>> for u32.
impl<T> From<T> for NewType<T>
impl<T> From<NewType<T>> for T
impl From<NewType<u32>> for u32
That leads to unfortunate huge sets of impls like https://docs.rs/simd-trick/0.3.0/simd_trick/struct.Simd.html#impl-From%3CSimd%3C%5Bm64%3B%208%5D%3E%3E
Couldn't you do impl Into<T> for NewType<T> though? And thus not have all those impls, given end users are supposed to bound on Into not From?
impl Into<T> for NewType<T>
Into
From
I can do
impl<T> From<T> for NewType<T>
, but I can't doimpl<T> From<NewType<T>> for T
even though I can doimpl From<NewType<u32>> for u32
.That leads to unfortunate huge sets of impls like https://docs.rs/simd-trick/0.3.0/simd_trick/struct.Simd.html#impl-From%3CSimd%3C%5Bm64%3B%208%5D%3E%3E