fn add_outlives_bounds<I>(
        &mut self,
        infcx: Option<&InferCtxt<'a, 'gcx, 'tcx>>,
        outlives_bounds: I,
    ) where
        I: IntoIterator<Item = OutlivesBound<'tcx>>,
    {
        // Record relationships such as `T:'x` that don't go into the
        // free-region-map but which we use here.
        for outlives_bound in outlives_bounds {
            debug!("add_outlives_bounds: outlives_bound={:?}", outlives_bound);
            match outlives_bound {
                OutlivesBound::RegionSubRegion(r_a @ &ty::ReEarlyBound(_), &ty::ReVar(vid_b)) |
                OutlivesBound::RegionSubRegion(r_a @ &ty::ReFree(_), &ty::ReVar(vid_b)) => {
                    infcx.expect("no infcx provided but region vars found").add_given(r_a, vid_b);
                }
                OutlivesBound::RegionSubParam(r_a, param_b) => {
                    self.region_bound_pairs
                        .push((r_a, GenericKind::Param(param_b)));
                }
                OutlivesBound::RegionSubProjection(r_a, projection_b) => {
                    self.region_bound_pairs
                        .push((r_a, GenericKind::Projection(projection_b)));
                }
                OutlivesBound::RegionSubRegion(r_a, r_b) => {
                    // In principle, we could record (and take
                    // advantage of) every relationship here, but
                    // we are also free not to -- it simply means
                    // strictly less that we can successfully type
                    // check. Right now we only look for things
                    // relationships between free regions. (It may
                    // also be that we should revise our inference
                    // system to be more general and to make use
                    // of *every* relationship that arises here,
                    // but presently we do not.)
                    self.free_region_map.relate_regions(r_a, r_b);
                }
            }
        }
    }
/// Processes outlives bounds that are known to hold, whether from implied or other sources.
///
/// The `infcx` parameter is optional; if the implied bounds may
/// contain inference variables, it must be supplied, in which
/// case we will register "givens" on the inference context. (See
/// `RegionConstraintData`.)
Processes outlives bounds that are known to hold, whether from implied or other sources.
The `infcx` parameter is optional; if the implied bounds may
contain inference variables, it must be supplied, in which
case we will register "givens" on the inference context.
Processes outlives bounds that are known to hold whether from implied or other sources . The ` infcx ` parameter is optional ; if the implied bounds may contain inference variables it must be supplied in which case we will register " givens " on the inference context .
fn add_outlives_bounds<I>(
        &mut self,
        infcx: Option<&InferCtxt<'a, 'gcx, 'tcx>>,
        outlives_bounds: I,
    ) where
        I: IntoIterator<Item = OutlivesBound<'tcx>>,
    {
        // Record relationships such as `T:'x` that don't go into the
        // free-region-map but which we use here.
        for outlives_bound in outlives_bounds {
            debug!("add_outlives_bounds: outlives_bound={:?}", outlives_bound);
            match outlives_bound {
                OutlivesBound::RegionSubRegion(r_a @ &ty::ReEarlyBound(_), &ty::ReVar(vid_b)) |
                OutlivesBound::RegionSubRegion(r_a @ &ty::ReFree(_), &ty::ReVar(vid_b)) => {
                    infcx.expect("no infcx provided but region vars found").add_given(r_a, vid_b);
                }
                OutlivesBound::RegionSubParam(r_a, param_b) => {
                    self.region_bound_pairs
                        .push((r_a, GenericKind::Param(param_b)));
                }
                OutlivesBound::RegionSubProjection(r_a, projection_b) => {
                    self.region_bound_pairs
                        .push((r_a, GenericKind::Projection(projection_b)));
                }
                OutlivesBound::RegionSubRegion(r_a, r_b) => {
                    // In principle, we could record (and take
                    // advantage of) every relationship here, but
                    // we are also free not to -- it simply means
                    // strictly less that we can successfully type
                    // check. Right now we only look for things
                    // relationships between free regions. (It may
                    // also be that we should revise our inference
                    // system to be more general and to make use
                    // of *every* relationship that arises here,
                    // but presently we do not.)
                    self.free_region_map.relate_regions(r_a, r_b);
                }
            }
        }
    }
fn add_outlives_bounds < I > ( & mut self , infcx : Option < & InferCtxt < ' a , ' gcx , ' tcx > > , outlives_bounds : I , ) where I : IntoIterator < Item = OutlivesBound < ' tcx > > , { // Record relationships such as `T:'x` that don't go into the // free-region-map but which we use here. for outlives_bound in outlives_bounds { debug ! ( " " outlives_bound ) ; match outlives_bound { OutlivesBound :: RegionSubRegion ( r_a @ & ty :: ReEarlyBound ( _ ) , & ty :: ReVar ( vid_b ) ) | OutlivesBound :: RegionSubRegion ( r_a @ & ty :: ReFree ( _ ) , & ty :: ReVar ( vid_b ) ) => { infcx . expect ( " " ) . add_given ( r_a , vid_b ) ; } OutlivesBound :: RegionSubParam ( r_a , param_b ) => { self . region_bound_pairs . push ( ( r_a , GenericKind :: Param ( param_b ) ) ) ; } OutlivesBound :: RegionSubProjection ( r_a , projection_b ) => { self . region_bound_pairs . push ( ( r_a , GenericKind :: Projection ( projection_b ) ) ) ; } OutlivesBound :: RegionSubRegion ( r_a , r_b ) => { // In principle, we could record (and take // advantage of) every relationship here, but // we are also free not to -- it simply means // strictly less that we can successfully type // check. Right now we only look for things // relationships between free regions. (It may // also be that we should revise our inference // system to be more general and to make use // of *every* relationship that arises here, // but presently we do not.) self . free_region_map . relate_regions ( r_a , r_b ) ; } } } }
Processes outlives bounds that are known to hold, whether from implied or other sources.
Processes outlives bounds that are known to hold whether from implied or other sources .
&mut self
infcx
Option<&InferCtxt<'a, 'gcx, 'tcx>>
outlives_bounds
I
&mut self
infcx
Option<&InferCtxt<'a, 'gcx, 'tcx>>
outlives_bounds
I