Open dhardy opened 5 years ago
Would specialization help with this case?
(I don't understand specialization enough to figure that out myself)
I presume it would, so long as the most generic impl uses the default
keyword (assuming specialization will work roughly as in the RFC).
impl<T> From<T> for T {
default fn from(t: T) -> T { t }
}
Creating a new issue because this is, in my opinion, probably the most commonly encountered and annoying to work around issue caused by no-orphan rules:
Namely, the special case where
A == B
overlaps with the genericimpl<T> From<T> for T
.It's also an instance where it's usually trivial to prove that the overlapping implementations are equivalent, though I realise this is probably not a productive path toward a solution.