crate fn new(set: &ConstraintSet, num_region_vars: usize) -> Self {
        let mut first_constraints = IndexVec::from_elem_n(None, num_region_vars);
        let mut next_constraints = IndexVec::from_elem(None, &set.constraints);

        for (idx, constraint) in set.constraints.iter_enumerated().rev() {
            let head = &mut first_constraints[constraint.sup];
            let next = &mut next_constraints[idx];
            debug_assert!(next.is_none());
            *next = *head;
            *head = Some(idx);
        }

        Self {
            first_constraints,
            next_constraints,
        }
    }
/// Create a "dependency graph" where each region constraint `R1:
/// R2` is treated as an edge `R1 -> R2`. We use this graph to
/// construct SCCs for region inference but also for error
/// reporting.
Create a "dependency graph" where each region constraint `R1:
R2` is treated as an edge `R1 -> R2`. We use this graph to
construct SCCs for region inference but also for error
reporting.
Create a " dependency graph " where each region constraint ` R1 : R2 ` is treated as an edge ` R1 - > R2 ` . We use this graph to construct SCCs for region inference but also for error reporting .
crate fn new(set: &ConstraintSet, num_region_vars: usize) -> Self {
        let mut first_constraints = IndexVec::from_elem_n(None, num_region_vars);
        let mut next_constraints = IndexVec::from_elem(None, &set.constraints);
        for (idx, constraint) in set.constraints.iter_enumerated().rev() {
            let head = &mut first_constraints[constraint.sup];
            let next = &mut next_constraints[idx];
            debug_assert!(next.is_none());
            *next = *head;
            *head = Some(idx);
        }
        Self {
            first_constraints,
            next_constraints,
        }
    }
crate fn new ( set : & ConstraintSet , num_region_vars : usize ) -> Self { let mut first_constraints = IndexVec :: from_elem_n ( None , num_region_vars ) ; let mut next_constraints = IndexVec :: from_elem ( None , & set . constraints ) ; for ( idx , constraint ) in set . constraints . iter_enumerated ( ) . rev ( ) { let head = & mut first_constraints [ constraint . sup ] ; let next = & mut next_constraints [ idx ] ; debug_assert ! ( next is_none ( ) ) ; * next = * head ; * head = Some ( idx ) ; } Self { first_constraints , next_constraints , } }
Create a "dependency graph" where each region constraint `R1:
R2` is treated as an edge `R1 -> R2`.
Create a " dependency graph " where each region constraint ` R1 : R2 ` is treated as an edge ` R1 - > R2 ` .
set
&ConstraintSet
num_region_vars
usize