Not to say that I like the Owned
proposal (especially the Deref
part), but with your IntoOwned<T>
you can't have these two implementations at the same time:
impl<T: Borrow<T>> IntoOwned<T> for T {}
impl<T: ToOwned> IntoOwned<<T as ToOwned>::Owned> for &T {}
The problem is that nothing prevents a U: ToOwned<Owned = &'static U>
from existing.
The first impl
with T = &'static U
would implement IntoOwned<&'static U>
for &'static U
.
The second impl
with T = U
would also implement IntoOwned<&'static U>
for &'static U
.