Struct rustc_infer::infer::lexical_region_resolve::LexicalResolver [−][src]
struct LexicalResolver<'cx, 'tcx> {
region_rels: &'cx RegionRelations<'cx, 'tcx>,
var_infos: VarInfos,
data: RegionConstraintData<'tcx>,
}Fields
region_rels: &'cx RegionRelations<'cx, 'tcx>var_infos: VarInfosdata: RegionConstraintData<'tcx>Implementations
fn infer_variable_values(
&mut self,
errors: &mut Vec<RegionResolutionError<'tcx>>
) -> LexicalRegionResolutions<'tcx>
Initially, the value for all variables is set to 'empty, the
empty region. The expansion phase will grow this larger.
An erased version of the lexical region resolutions. Used when we’re
erasing regions and suppressing errors: in item bodies with
-Zborrowck=mir.
fn enforce_member_constraints(
&self,
graph: &Graph<(), Constraint<'tcx>>,
var_values: &mut LexicalRegionResolutions<'tcx>
) -> bool
fn enforce_member_constraints(
&self,
graph: &Graph<(), Constraint<'tcx>>,
var_values: &mut LexicalRegionResolutions<'tcx>
) -> bool
Enforce all member constraints and return true if anything
changed. See enforce_member_constraint for more details.
fn enforce_member_constraint(
&self,
graph: &Graph<(), Constraint<'tcx>>,
member_constraint: &MemberConstraint<'tcx>,
var_values: &mut LexicalRegionResolutions<'tcx>
) -> bool
fn enforce_member_constraint(
&self,
graph: &Graph<(), Constraint<'tcx>>,
member_constraint: &MemberConstraint<'tcx>,
var_values: &mut LexicalRegionResolutions<'tcx>
) -> bool
Enforce a constraint like
'r member of ['c...]
We look for all choice regions from the list 'c... that:
(a) are greater than the current value of 'r (which is a lower bound)
and
(b) are compatible with the upper bounds of 'r that we can
find by traversing the graph.
From that list, we look for a minimal option 'c_min. If we
find one, then we can enforce that 'r: 'c_min.
fn expand_node(
&self,
a_region: Region<'tcx>,
b_vid: RegionVid,
b_data: &mut VarValue<'tcx>
) -> bool
True if a <= b, but not defined over inference variables.
Returns the least-upper-bound of a and b; i.e., the
smallest region c such that a <= c and b <= c.
Neither a nor b may be an inference variable (hence the
term “concrete regions”).
fn collect_errors(
&self,
var_data: &mut LexicalRegionResolutions<'tcx>,
errors: &mut Vec<RegionResolutionError<'tcx>>
)
fn collect_errors(
&self,
var_data: &mut LexicalRegionResolutions<'tcx>,
errors: &mut Vec<RegionResolutionError<'tcx>>
)
After expansion is complete, go and check upper bounds (i.e., cases where the region cannot grow larger than a fixed point) and check that they are satisfied.
fn collect_var_errors(
&self,
var_data: &LexicalRegionResolutions<'tcx>,
graph: &Graph<(), Constraint<'tcx>>,
errors: &mut Vec<RegionResolutionError<'tcx>>
)
fn collect_var_errors(
&self,
var_data: &LexicalRegionResolutions<'tcx>,
graph: &Graph<(), Constraint<'tcx>>,
errors: &mut Vec<RegionResolutionError<'tcx>>
)
Go over the variables that were declared to be error variables
and create a RegionResolutionError for each of them.
fn collect_error_for_expanding_node(
&self,
graph: &Graph<(), Constraint<'tcx>>,
dup_vec: &mut IndexVec<RegionVid, Option<RegionVid>>,
node_idx: RegionVid,
errors: &mut Vec<RegionResolutionError<'tcx>>
)
Collects all regions that “bound” the variable orig_node_idx in the
given direction.
If dup_vec is Some it’s used to track duplicates between successive
calls of this function.
The return tuple fields are:
- a list of all concrete regions bounding the given region.
- the set of all region variables bounding the given region.
- a
boolthat’s true if the returned region variables overlap with those returned by a previous call for another region.
fn bound_is_met(
&self,
bound: &VerifyBound<'tcx>,
var_values: &LexicalRegionResolutions<'tcx>,
generic_ty: Ty<'tcx>,
min: Region<'tcx>
) -> bool
Auto Trait Implementations
impl<'cx, 'tcx> !RefUnwindSafe for LexicalResolver<'cx, 'tcx>
impl<'cx, 'tcx> !Send for LexicalResolver<'cx, 'tcx>
impl<'cx, 'tcx> !Sync for LexicalResolver<'cx, 'tcx>
impl<'cx, 'tcx> Unpin for LexicalResolver<'cx, 'tcx> where
'tcx: 'cx,
impl<'cx, 'tcx> !UnwindSafe for LexicalResolver<'cx, 'tcx>
Blanket Implementations
Layout
Note: Most layout information is completely unstable and may be different between compiler versions and platforms. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 136 bytes