Why can't I `impl<E> From<E> for EzError where E: StdError + Send`?

In the past there have been problems with negative trait bounds because adding a trait implementation would become a breaking change (sort of, see RFC #1658). However, negative equality bounds don’t have this problem at all.

Also, a more general (unstable) solution to the above problem is:

#![feature(optin_builtin_traits)]
pub trait NotSame {}
impl NotSame for .. {}
impl<T> !NotSame for (T, T) {}

// Example: usage:
trait Trait<T> {}
impl<T> Trait<T> for T {}
impl<A, B> Trait<A> for B where (A, B): NotSame {}
1 Like