Closed milancermak closed 9 months ago
A negative impl, AFAIU, works as a restriction meaning "type does not implement this trait". An opposite of a positive impl ("type implements this trait").
So my idea was to do impl DislayUsingDebug<T, impl TDebug: Debug<T>, -Display<T>> of Display<T>
to say "any type that implements Debug but not Display" because we could have e.g. a Display impl for Health in which case we'd want to use the more specific and prevent clashes for the implementation.
A generic impl of Display using Debug.
I think this is safe because it only applies to our types. I've tried making the declaration stricter by using a negative impl
-Display<T>
but that didn't compile 🤷