You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#![crate_type = "lib"]pubtraitBound<T>{}pubtraitTrait:Bound<i8> + Bound<u8>{}//~^ error: trait `Bound<u8>` already appears in the list of boundsfnfoo<T:Bound<i8> + Bound<u8>>(){}//~^ error: trait `Bound<u8>` already appears in the list of boundsfnfoo<T>()whereT:Bound<i8> + Bound<u8>{}// OK
Due to multidispatch : Bound<i8> + Bound<u8> is a valid bound, but the compiler is rejecting it in some positions (supertraits and bounds in parameter list), but not in others (where clauses)
Workaround for the supertrait
You can use dummy intermediate traits to indirectly add the "duplicate" bounds, but this is very verbose.