As part of generating the regions, if you enable
-Zdump-mir=nll, we will generate an annotated copy of the MIR that includes the state of region inference. This code handles emitting the region context internal state.
This module provides linkage between RegionInferenceContext and
rustc_graphviztraits, specialized to attaching borrowck analysis data to rendered labels.
Each time that
apply_member_constraintis successful, it appends one of these structs to the
member_constraints_appliedfield. This is used in error reporting to trace out what happened.
A “type test” corresponds to an outlives constraint between a type and a lifetime, like
<T as Foo>::Bar: 'x. They are translated from the
Verifyregion constraints in the ordinary inference context.
N.B., the variants in
Causeare intentionally ordered. Lower values are preferred when it comes to error messages. Do not reorder willy nilly.
When we have an unmet lifetime constraint, we try to propagate it outward (e.g. to a closure environment). If we can’t, it is an error.