To me it seems logical that Option<T>
and Option<U>
should be comparable if T
and U
are comparable (i.e. impl PartialEq<U> for T
). However, it seems that Option<T>
can only be compared with Option<T>
.
Similarly, Result<T, E>
can only be compared with Result<T, E>
, and not some other Result<U, F>
, where T: PartialEq<U>
and E: PartialEq<F>
.
Is there a reason for this restriction?