fn check_universal_region(
        &self,
        infcx: &InferCtxt<'_, 'tcx>,
        body: &Body<'tcx>,
        local_names: &IndexVec<Local, Option<Symbol>>,
        upvars: &[Upvar],
        mir_def_id: DefId,
        longer_fr: RegionVid,
        propagated_outlives_requirements: &mut Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>,
        outlives_suggestion: &mut OutlivesSuggestionBuilder<'_>,
        errors_buffer: &mut Vec<Diagnostic>,
        region_naming: &mut RegionErrorNamingCtx,
    ) {
        debug!("check_universal_region(fr={:?})", longer_fr);

        let longer_fr_scc = self.constraint_sccs.scc(longer_fr);

        // Because this free region must be in the ROOT universe, we
        // know it cannot contain any bound universes.
        assert!(self.scc_universes[longer_fr_scc] == ty::UniverseIndex::ROOT);
        debug_assert!(self.scc_values.placeholders_contained_in(longer_fr_scc).next().is_none());

        // Only check all of the relations for the main representative of each
        // SCC, otherwise just check that we outlive said representative. This
        // reduces the number of redundant relations propagated out of
        // closures.
        // Note that the representative will be a universal region if there is
        // one in this SCC, so we will always check the representative here.
        let representative = self.scc_representatives[longer_fr_scc];
        if representative != longer_fr {
            self.check_universal_region_relation(
                longer_fr,
                representative,
                infcx,
                body,
                local_names,
                upvars,
                mir_def_id,
                propagated_outlives_requirements,
                outlives_suggestion,
                errors_buffer,
                region_naming,
            );
            return;
        }

        // Find every region `o` such that `fr: o`
        // (because `fr` includes `end(o)`).
        for shorter_fr in self.scc_values.universal_regions_outlived_by(longer_fr_scc) {
            if let Some(ErrorReported) = self.check_universal_region_relation(
                longer_fr,
                shorter_fr,
                infcx,
                body,
                local_names,
                upvars,
                mir_def_id,
                propagated_outlives_requirements,
                outlives_suggestion,
                errors_buffer,
                region_naming,
            ) {
                // continuing to iterate just reports more errors than necessary
                //
                // FIXME It would also allow us to report more Outlives Suggestions, though, so
                // it's not clear that that's a bad thing. Somebody should try commenting out this
                // line and see it is actually a regression.
                return;
            }
        }
    }
/// Checks the final value for the free region `fr` to see if it
/// grew too large. In particular, examine what `end(X)` points
/// wound up in `fr`'s final value; for each `end(X)` where `X !=
/// fr`, we want to check that `fr: X`. If not, that's either an
/// error, or something we have to propagate to our creator.
///
/// Things that are to be propagated are accumulated into the
/// `outlives_requirements` vector.
Checks the final value for the free region `fr` to see if it
grew too large.

Things that are to be propagated are accumulated into the
`outlives_requirements` vector.
Checks the final value for the free region ` fr ` to see if it grew too large . Things that are to be propagated are accumulated into the ` outlives_requirements ` vector .
fn check_universal_region(
        &self,
        infcx: &InferCtxt<'_, 'tcx>,
        body: &Body<'tcx>,
        local_names: &IndexVec<Local, Option<Symbol>>,
        upvars: &[Upvar],
        mir_def_id: DefId,
        longer_fr: RegionVid,
        propagated_outlives_requirements: &mut Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>,
        outlives_suggestion: &mut OutlivesSuggestionBuilder<'_>,
        errors_buffer: &mut Vec<Diagnostic>,
        region_naming: &mut RegionErrorNamingCtx,
    ) {
        debug!("check_universal_region(fr={:?})", longer_fr);
        let longer_fr_scc = self.constraint_sccs.scc(longer_fr);
        // Because this free region must be in the ROOT universe, we
        // know it cannot contain any bound universes.
        assert!(self.scc_universes[longer_fr_scc] == ty::UniverseIndex::ROOT);
        debug_assert!(self.scc_values.placeholders_contained_in(longer_fr_scc).next().is_none());
        // Only check all of the relations for the main representative of each
        // SCC, otherwise just check that we outlive said representative. This
        // reduces the number of redundant relations propagated out of
        // closures.
        // Note that the representative will be a universal region if there is
        // one in this SCC, so we will always check the representative here.
        let representative = self.scc_representatives[longer_fr_scc];
        if representative != longer_fr {
            self.check_universal_region_relation(
                longer_fr,
                representative,
                infcx,
                body,
                local_names,
                upvars,
                mir_def_id,
                propagated_outlives_requirements,
                outlives_suggestion,
                errors_buffer,
                region_naming,
            );
            return;
        }
        // Find every region `o` such that `fr: o`
        // (because `fr` includes `end(o)`).
        for shorter_fr in self.scc_values.universal_regions_outlived_by(longer_fr_scc) {
            if let Some(ErrorReported) = self.check_universal_region_relation(
                longer_fr,
                shorter_fr,
                infcx,
                body,
                local_names,
                upvars,
                mir_def_id,
                propagated_outlives_requirements,
                outlives_suggestion,
                errors_buffer,
                region_naming,
            ) {
                // continuing to iterate just reports more errors than necessary
                //
                // FIXME It would also allow us to report more Outlives Suggestions, though, so
                // it's not clear that that's a bad thing. Somebody should try commenting out this
                // line and see it is actually a regression.
                return;
            }
        }
    }
fn check_universal_region ( & self , infcx : & InferCtxt < ' _ , ' tcx > , body : & Body < ' tcx > , local_names : & IndexVec < Local , Option < Symbol > > , upvars : & [ Upvar ] , mir_def_id : DefId , longer_fr : RegionVid , propagated_outlives_requirements : & mut Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > , outlives_suggestion : & mut OutlivesSuggestionBuilder < ' _ > , errors_buffer : & mut Vec < Diagnostic > , region_naming : & mut RegionErrorNamingCtx , ) { debug ! ( " " longer_fr ) ; let longer_fr_scc = self . constraint_sccs . scc ( longer_fr ) ; // Because this free region must be in the ROOT universe, we // know it cannot contain any bound universes. assert ! ( self scc_universes [ longer_fr_scc ] ty UniverseIndex ROOT ) ; debug_assert ! ( self scc_values placeholders_contained_in ( longer_fr_scc ) next ( ) is_none ( ) ) ; // Only check all of the relations for the main representative of each // SCC, otherwise just check that we outlive said representative. This // reduces the number of redundant relations propagated out of // closures. // Note that the representative will be a universal region if there is // one in this SCC, so we will always check the representative here. let representative = self . scc_representatives [ longer_fr_scc ] ; if representative != longer_fr { self . check_universal_region_relation ( longer_fr , representative , infcx , body , local_names , upvars , mir_def_id , propagated_outlives_requirements , outlives_suggestion , errors_buffer , region_naming , ) ; return ; } // Find every region `o` such that `fr: o` // (because `fr` includes `end(o)`). for shorter_fr in self . scc_values . universal_regions_outlived_by ( longer_fr_scc ) { if let Some ( ErrorReported ) = self . check_universal_region_relation ( longer_fr , shorter_fr , infcx , body , local_names , upvars , mir_def_id , propagated_outlives_requirements , outlives_suggestion , errors_buffer , region_naming , ) { // continuing to iterate just reports more errors than necessary // // FIXME It would also allow us to report more Outlives Suggestions, though, so // it's not clear that that's a bad thing. Somebody should try commenting out this // line and see it is actually a regression. return ; } } }
Checks the final value for the free region `fr` to see if it
grew too large.
Checks the final value for the free region ` fr ` to see if it grew too large .
&self
infcx
&InferCtxt<'_, 'tcx>
body
&Body<'tcx>
local_names
&IndexVec<Local, Option<Symbol>>
upvars
&[Upvar]
mir_def_id
DefId
longer_fr
RegionVid
propagated_outlives_requirements
&mut Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>
outlives_suggestion
&mut OutlivesSuggestionBuilder<'_>
errors_buffer
&mut Vec<Diagnostic>
region_naming
&mut RegionErrorNamingCtx