pub fn pop_skolemized(
        &mut self,
        skolemization_count: ty::UniverseIndex,
        skols: &FxHashSet<ty::Region<'tcx>>,
        snapshot: &RegionSnapshot,
    ) {
        debug!("pop_skolemized_regions(skols={:?})", skols);

        assert!(self.in_snapshot());
        assert!(self.undo_log[snapshot.length] == OpenSnapshot);
        assert!(
            skolemization_count.as_usize() >= skols.len(),
            "popping more skolemized variables than actually exist, \
             sc now = {:?}, skols.len = {:?}",
            skolemization_count,
            skols.len()
        );

        let last_to_pop = skolemization_count.subuniverse();
        let first_to_pop = ty::UniverseIndex::from(last_to_pop.as_u32() - skols.len() as u32);

        debug_assert! {
            skols.iter()
                 .all(|&k| match *k {
                     ty::ReSkolemized(universe, _) =>
                         universe >= first_to_pop &&
                         universe < last_to_pop,
                     _ =>
                         false
                 }),
            "invalid skolemization keys or keys out of range ({:?}..{:?}): {:?}",
            first_to_pop,
            last_to_pop,
            skols
        }

        let constraints_to_kill: Vec<usize> = self.undo_log
            .iter()
            .enumerate()
            .rev()
            .filter(|&(_, undo_entry)| kill_constraint(skols, undo_entry))
            .map(|(index, _)| index)
            .collect();

        for index in constraints_to_kill {
            let undo_entry = mem::replace(&mut self.undo_log[index], Purged);
            self.rollback_undo_entry(undo_entry);
        }

        return;

        fn kill_constraint<'tcx>(
            skols: &FxHashSet<ty::Region<'tcx>>,
            undo_entry: &UndoLogEntry<'tcx>,
        ) -> bool {
            match undo_entry {
                &AddConstraint(Constraint::VarSubVar(..)) => false,
                &AddConstraint(Constraint::RegSubVar(a, _)) => skols.contains(&a),
                &AddConstraint(Constraint::VarSubReg(_, b)) => skols.contains(&b),
                &AddConstraint(Constraint::RegSubReg(a, b)) => {
                    skols.contains(&a) || skols.contains(&b)
                }
                &AddGiven(..) => false,
                &AddVerify(_) => false,
                &AddCombination(_, ref two_regions) => {
                    skols.contains(&two_regions.a) || skols.contains(&two_regions.b)
                }
                &AddVar(..) | &OpenSnapshot | &Purged | &CommitedSnapshot => false,
            }
        }
    }
/// Removes all the edges to/from the skolemized regions that are
/// in `skols`. This is used after a higher-ranked operation
/// completes to remove all trace of the skolemized regions
/// created in that time.
Removes all the edges to/from the skolemized regions that are
in `skols`. This is used after a higher-ranked operation
completes to remove all trace of the skolemized regions
created in that time.
Removes all the edges to / from the skolemized regions that are in ` skols ` . This is used after a higher - ranked operation completes to remove all trace of the skolemized regions created in that time .
pub fn pop_skolemized(
        &mut self,
        skolemization_count: ty::UniverseIndex,
        skols: &FxHashSet<ty::Region<'tcx>>,
        snapshot: &RegionSnapshot,
    ) {
        debug!("pop_skolemized_regions(skols={:?})", skols);
        assert!(self.in_snapshot());
        assert!(self.undo_log[snapshot.length] == OpenSnapshot);
        assert!(
            skolemization_count.as_usize() >= skols.len(),
            "popping more skolemized variables than actually exist, \
             sc now = {:?}, skols.len = {:?}",
            skolemization_count,
            skols.len()
        );
        let last_to_pop = skolemization_count.subuniverse();
        let first_to_pop = ty::UniverseIndex::from(last_to_pop.as_u32() - skols.len() as u32);
        debug_assert! {
            skols.iter()
                 .all(|&k| match *k {
                     ty::ReSkolemized(universe, _) =>
                         universe >= first_to_pop &&
                         universe < last_to_pop,
                     _ =>
                         false
                 }),
            "invalid skolemization keys or keys out of range ({:?}..{:?}): {:?}",
            first_to_pop,
            last_to_pop,
            skols
        }
        let constraints_to_kill: Vec<usize> = self.undo_log
            .iter()
            .enumerate()
            .rev()
            .filter(|&(_, undo_entry)| kill_constraint(skols, undo_entry))
            .map(|(index, _)| index)
            .collect();
        for index in constraints_to_kill {
            let undo_entry = mem::replace(&mut self.undo_log[index], Purged);
            self.rollback_undo_entry(undo_entry);
        }
        return;
        fn kill_constraint<'tcx>(
            skols: &FxHashSet<ty::Region<'tcx>>,
            undo_entry: &UndoLogEntry<'tcx>,
        ) -> bool {
            match undo_entry {
                &AddConstraint(Constraint::VarSubVar(..)) => false,
                &AddConstraint(Constraint::RegSubVar(a, _)) => skols.contains(&a),
                &AddConstraint(Constraint::VarSubReg(_, b)) => skols.contains(&b),
                &AddConstraint(Constraint::RegSubReg(a, b)) => {
                    skols.contains(&a) || skols.contains(&b)
                }
                &AddGiven(..) => false,
                &AddVerify(_) => false,
                &AddCombination(_, ref two_regions) => {
                    skols.contains(&two_regions.a) || skols.contains(&two_regions.b)
                }
                &AddVar(..) | &OpenSnapshot | &Purged | &CommitedSnapshot => false,
            }
        }
    }
pub fn pop_skolemized ( & mut self , skolemization_count : ty :: UniverseIndex , skols : & FxHashSet < ty :: Region < ' tcx > > , snapshot : & RegionSnapshot , ) { debug ! ( " " skols ) ; assert ! ( self in_snapshot ( ) ) ; assert ! ( self undo_log [ snapshot length ] OpenSnapshot ) ; assert ! ( skolemization_count as_usize ( ) skols len ( ) " \
 " skolemization_count skols len ( ) ) ; let last_to_pop = skolemization_count . subuniverse ( ) ; let first_to_pop = ty :: UniverseIndex :: from ( last_to_pop . as_u32 ( ) - skols . len ( ) as u32 ) ; debug_assert ! { skols iter ( ) all ( k match k { ty ReSkolemized ( universe ) universe first_to_pop universe last_to_pop false } ) " " first_to_pop last_to_pop skols } let constraints_to_kill : Vec < usize > = self . undo_log . iter ( ) . enumerate ( ) . rev ( ) . filter ( | & ( _ , undo_entry ) | kill_constraint ( skols , undo_entry ) ) . map ( | ( index , _ ) | index ) . collect ( ) ; for index in constraints_to_kill { let undo_entry = mem :: replace ( & mut self . undo_log [ index ] , Purged ) ; self . rollback_undo_entry ( undo_entry ) ; } return ; fn kill_constraint < ' tcx > ( skols : & FxHashSet < ty :: Region < ' tcx > > , undo_entry : & UndoLogEntry < ' tcx > , ) -> bool { match undo_entry { & AddConstraint ( Constraint :: VarSubVar ( .. ) ) => false , & AddConstraint ( Constraint :: RegSubVar ( a , _ ) ) => skols . contains ( & a ) , & AddConstraint ( Constraint :: VarSubReg ( _ , b ) ) => skols . contains ( & b ) , & AddConstraint ( Constraint :: RegSubReg ( a , b ) ) => { skols . contains ( & a ) || skols . contains ( & b ) } & AddGiven ( .. ) => false , & AddVerify ( _ ) => false , & AddCombination ( _ , ref two_regions ) => { skols . contains ( & two_regions . a ) || skols . contains ( & two_regions . b ) } & AddVar ( .. ) | & OpenSnapshot | & Purged | & CommitedSnapshot => false , } } }
Removes all the edges to/from the skolemized regions that are
in `skols`.
Removes all the edges to / from the skolemized regions that are in ` skols ` .
&mut self
skolemization_count
ty::UniverseIndex
skols
&FxHashSet<ty::Region<'tcx>>
snapshot
&RegionSnapshot
&mut self
skolemization_count
ty::UniverseIndex
skols
&FxHashSet<ty::Region<'tcx>>
snapshot
&RegionSnapshot