fn collect_errors(
        &self,
        var_data: &mut LexicalRegionResolutions<'tcx>,
        errors: &mut Vec<RegionResolutionError<'tcx>>,
    ) {
        for (constraint, origin) in &self.data.constraints {
            debug!(
                "collect_errors: constraint={:?} origin={:?}",
                constraint,
                origin
            );
            match *constraint {
                Constraint::RegSubVar(..) | Constraint::VarSubVar(..) => {
                    // Expansion will ensure that these constraints hold. Ignore.
                }

                Constraint::RegSubReg(sub, sup) => {
                    if self.region_rels.is_subregion_of(sub, sup) {
                        continue;
                    }

                    debug!(
                        "collect_errors: region error at {:?}: \
                         cannot verify that {:?} <= {:?}",
                        origin,
                        sub,
                        sup
                    );

                    errors.push(RegionResolutionError::ConcreteFailure(
                        (*origin).clone(),
                        sub,
                        sup,
                    ));
                }

                Constraint::VarSubReg(a_vid, b_region) => {
                    let a_data = var_data.value_mut(a_vid);
                    debug!("contraction: {:?} == {:?}, {:?}", a_vid, a_data, b_region);

                    let a_region = match *a_data {
                        VarValue::ErrorValue => continue,
                        VarValue::Value(a_region) => a_region,
                    };

                    // Do not report these errors immediately:
                    // instead, set the variable value to error and
                    // collect them later.
                    if !self.region_rels.is_subregion_of(a_region, b_region) {
                        debug!(
                            "collect_errors: region error at {:?}: \
                             cannot verify that {:?}={:?} <= {:?}",
                            origin,
                            a_vid,
                            a_region,
                            b_region
                        );
                        *a_data = VarValue::ErrorValue;
                    }
                }
            }
        }

        for verify in &self.data.verifys {
            debug!("collect_errors: verify={:?}", verify);
            let sub = var_data.normalize(verify.region);

            // This was an inference variable which didn't get
            // constrained, therefore it can be assume to hold.
            if let ty::ReEmpty = *sub {
                continue;
            }

            if self.bound_is_met(&verify.bound, var_data, sub) {
                continue;
            }

            debug!(
                "collect_errors: region error at {:?}: \
                 cannot verify that {:?} <= {:?}",
                verify.origin,
                verify.region,
                verify.bound
            );

            errors.push(RegionResolutionError::GenericBoundFailure(
                verify.origin.clone(),
                verify.kind.clone(),
                sub,
            ));
        }
    }
/// 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.
After expansion is complete, go and check upper bounds
and check that they are satisfied.
After expansion is complete go and check upper bounds and check that they are satisfied .
fn collect_errors(
        &self,
        var_data: &mut LexicalRegionResolutions<'tcx>,
        errors: &mut Vec<RegionResolutionError<'tcx>>,
    ) {
        for (constraint, origin) in &self.data.constraints {
            debug!(
                "collect_errors: constraint={:?} origin={:?}",
                constraint,
                origin
            );
            match *constraint {
                Constraint::RegSubVar(..) | Constraint::VarSubVar(..) => {
                    // Expansion will ensure that these constraints hold. Ignore.
                }
                Constraint::RegSubReg(sub, sup) => {
                    if self.region_rels.is_subregion_of(sub, sup) {
                        continue;
                    }
                    debug!(
                        "collect_errors: region error at {:?}: \
                         cannot verify that {:?} <= {:?}",
                        origin,
                        sub,
                        sup
                    );
                    errors.push(RegionResolutionError::ConcreteFailure(
                        (*origin).clone(),
                        sub,
                        sup,
                    ));
                }
                Constraint::VarSubReg(a_vid, b_region) => {
                    let a_data = var_data.value_mut(a_vid);
                    debug!("contraction: {:?} == {:?}, {:?}", a_vid, a_data, b_region);
                    let a_region = match *a_data {
                        VarValue::ErrorValue => continue,
                        VarValue::Value(a_region) => a_region,
                    };
                    // Do not report these errors immediately:
                    // instead, set the variable value to error and
                    // collect them later.
                    if !self.region_rels.is_subregion_of(a_region, b_region) {
                        debug!(
                            "collect_errors: region error at {:?}: \
                             cannot verify that {:?}={:?} <= {:?}",
                            origin,
                            a_vid,
                            a_region,
                            b_region
                        );
                        *a_data = VarValue::ErrorValue;
                    }
                }
            }
        }
        for verify in &self.data.verifys {
            debug!("collect_errors: verify={:?}", verify);
            let sub = var_data.normalize(verify.region);
            // This was an inference variable which didn't get
            // constrained, therefore it can be assume to hold.
            if let ty::ReEmpty = *sub {
                continue;
            }
            if self.bound_is_met(&verify.bound, var_data, sub) {
                continue;
            }
            debug!(
                "collect_errors: region error at {:?}: \
                 cannot verify that {:?} <= {:?}",
                verify.origin,
                verify.region,
                verify.bound
            );
            errors.push(RegionResolutionError::GenericBoundFailure(
                verify.origin.clone(),
                verify.kind.clone(),
                sub,
            ));
        }
    }
fn collect_errors ( & self , var_data : & mut LexicalRegionResolutions < ' tcx > , errors : & mut Vec < RegionResolutionError < ' tcx > > , ) { for ( constraint , origin ) in & self . data . constraints { debug ! ( " " constraint origin ) ; match * constraint { Constraint :: RegSubVar ( .. ) | Constraint :: VarSubVar ( .. ) => { // Expansion will ensure that these constraints hold. Ignore. } Constraint :: RegSubReg ( sub , sup ) => { if self . region_rels . is_subregion_of ( sub , sup ) { continue ; } debug ! ( " \
 " origin sub sup ) ; errors . push ( RegionResolutionError :: ConcreteFailure ( ( * origin ) . clone ( ) , sub , sup , ) ) ; } Constraint :: VarSubReg ( a_vid , b_region ) => { let a_data = var_data . value_mut ( a_vid ) ; debug ! ( " " a_vid a_data b_region ) ; let a_region = match * a_data { VarValue :: ErrorValue => continue , VarValue :: Value ( a_region ) => a_region , } ; // Do not report these errors immediately: // instead, set the variable value to error and // collect them later. if ! self . region_rels . is_subregion_of ( a_region , b_region ) { debug ! ( " \
 " origin a_vid a_region b_region ) ; * a_data = VarValue :: ErrorValue ; } } } } for verify in & self . data . verifys { debug ! ( " " verify ) ; let sub = var_data . normalize ( verify . region ) ; // This was an inference variable which didn't get // constrained, therefore it can be assume to hold. if let ty :: ReEmpty = * sub { continue ; } if self . bound_is_met ( & verify . bound , var_data , sub ) { continue ; } debug ! ( " \
 " verify origin verify region verify bound ) ; errors . push ( RegionResolutionError :: GenericBoundFailure ( verify . origin . clone ( ) , verify . kind . clone ( ) , sub , ) ) ; } }
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.
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 .
&self
var_data
&mut LexicalRegionResolutions<'tcx>
errors
&mut Vec<RegionResolutionError<'tcx>>
&self
var_data
&mut LexicalRegionResolutions<'tcx>
errors
&mut Vec<RegionResolutionError<'tcx>>