Expand description
During type inference, partially inferred terms are
represented using inference variables (ty::Infer). These don’t appear in
the final ty::TypeckResults
since all of the types should have been
inferred once typeck is done.
When type inference is running however, having to update the typeck results
every time a new type is inferred would be unreasonably slow, so instead all
of the replacement happens at the end in FnCtxt::resolve_type_vars_in_body
,
which creates a new TypeckResults
which doesn’t contain any inference variables.
Structs§
- Eagerly
Normalize 🔒Consts - HasRecursive
Opaque 🔒 - Resolver 🔒
- Writeback
Cx 🔒 - The Writeback context. This visitor walks the HIR, checking the
fn-specific typeck results to find inference variables. It resolves
those inference variables and writes the final result into the
TypeckResults
. It also applies a few ad-hoc checks that were not convenient to do elsewhere.