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
It is obvious, that Ccannot in any way implement the same trait so the associated Type is both () and Vec<C> at the same time. The compiler should be able to infer that these trait implementations are completely independent. Alas, in the current nightly you get something like
error[E0119]: conflicting implementations of trait `std::fmt::Display` for type `Stuff<_>`:
--> <anon>:24:1
|
15 | impl<C> ::std::fmt::Display for Stuff<C>
| - first implementation here
...
24 | impl<C> ::std::fmt::Display for Stuff<C>
| ^ conflicting implementation for `Stuff<_>`
Consider code like this:
Play here
It is obvious, that
C
cannot in any way implement the same trait so the associatedType
is both()
andVec<C>
at the same time. The compiler should be able to infer that these trait implementations are completely independent. Alas, in the current nightly you get something likeinstead.
cc @nikomatsakis @eddyb
The text was updated successfully, but these errors were encountered: