[−][src]Module rustc_typeck::impl_wf_check

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

min_specialization

Minimal Specialization

Structs

ImplWfCheck

Functions

check_mod_impl_wf
enforce_impl_items_are_distinct

Enforce that we do not have two items in an impl with the same name.

enforce_impl_params_are_constrained
impl_wf_check

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).

provide
report_unused_parameter