rustc_hir_typeck::writeback - Rust (original) (raw)
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.
HasRecursiveOpaque ๐
Resolver ๐
WritebackCx ๐
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 theTypeckResults
. It also applies a few ad-hoc checks that were not convenient to do elsewhere.
Locatable ๐