Expand description
This pass enforces various “well-formedness constraints” on impls. Logically, it is part of wfcheck – but we do it early so that we can stop compilation afterwards, since part of the trait matching infrastructure gets very grumpy if these conditions don’t hold. In particular, if there are type parameters that are not part of the impl, then coherence will report strange inference ambiguity errors; if impls have duplicate items, we get misleading specialization errors. These things can (and probably should) be fixed, but for the moment it’s easier to do these checks early.
Modules§
- Minimal Specialization
Functions§
- Checks that all the type/lifetime parameters on an impl also appear in the trait ref or self type (or are constrained by a where-clause). These rules are needed to ensure that, given a trait ref like
<T as Trait<U>>
, we can derive the values of all parameters on the impl (which is needed to make specialization possible).