fn add_constraints_from_substs(&mut self,
                                   def_id: ast::DefId,
                                   generics: &ty::Generics,
                                   substs: &ty::substs,
                                   variance: VarianceTermPtr<'a>) {
        debug!("add_constraints_from_substs(def_id={:?})", def_id);

        for (i, p) in generics.type_param_defs.iter().enumerate() {
            let variance_decl =
                self.declared_variance(p.def_id, def_id, TypeParam, i);
            let variance_i = self.xform(variance, variance_decl);
            self.add_constraints_from_ty(substs.tps[i], variance_i);
        }

        match substs.regions {
            ty::ErasedRegions => {}
            ty::NonerasedRegions(ref rps) => {
                for (i, p) in generics.region_param_defs.iter().enumerate() {
                    let variance_decl =
                        self.declared_variance(p.def_id, def_id, RegionParam, i);
                    let variance_i = self.xform(variance, variance_decl);
                    self.add_constraints_from_region(*rps.get(i), variance_i);
                }
            }
        }
    }
/// Adds constraints appropriate for a nominal type (enum, struct,
/// object, etc) appearing in a context with ambient variance `variance`
Adds constraints appropriate for a nominal type (enum, struct,
object, etc) appearing in a context with ambient variance `variance`
Adds constraints appropriate for a nominal type ( enum struct object etc ) appearing in a context with ambient variance ` variance `
fn add_constraints_from_substs(&mut self,
                                   def_id: ast::DefId,
                                   generics: &ty::Generics,
                                   substs: &ty::substs,
                                   variance: VarianceTermPtr<'a>) {
        debug!("add_constraints_from_substs(def_id={:?})", def_id);
        for (i, p) in generics.type_param_defs.iter().enumerate() {
            let variance_decl =
                self.declared_variance(p.def_id, def_id, TypeParam, i);
            let variance_i = self.xform(variance, variance_decl);
            self.add_constraints_from_ty(substs.tps[i], variance_i);
        }
        match substs.regions {
            ty::ErasedRegions => {}
            ty::NonerasedRegions(ref rps) => {
                for (i, p) in generics.region_param_defs.iter().enumerate() {
                    let variance_decl =
                        self.declared_variance(p.def_id, def_id, RegionParam, i);
                    let variance_i = self.xform(variance, variance_decl);
                    self.add_constraints_from_region(*rps.get(i), variance_i);
                }
            }
        }
    }
fn add_constraints_from_substs ( & mut self , def_id : ast :: DefId , generics : & ty :: Generics , substs : & ty :: substs , variance : VarianceTermPtr < ' a > ) { debug ! ( " " def_id ) ; for ( i , p ) in generics . type_param_defs . iter ( ) . enumerate ( ) { let variance_decl = self . declared_variance ( p . def_id , def_id , TypeParam , i ) ; let variance_i = self . xform ( variance , variance_decl ) ; self . add_constraints_from_ty ( substs . tps [ i ] , variance_i ) ; } match substs . regions { ty :: ErasedRegions => { } ty :: NonerasedRegions ( ref rps ) => { for ( i , p ) in generics . region_param_defs . iter ( ) . enumerate ( ) { let variance_decl = self . declared_variance ( p . def_id , def_id , RegionParam , i ) ; let variance_i = self . xform ( variance , variance_decl ) ; self . add_constraints_from_region ( * rps . get ( i ) , variance_i ) ; } } } }
Adds constraints appropriate for a nominal type (enum, struct,
object, etc) appearing in a context with ambient variance `variance`
Adds constraints appropriate for a nominal type ( enum struct object etc ) appearing in a context with ambient variance ` variance `
&mut self
def_id
ast::DefId
generics
&ty::Generics
substs
&ty::substs
variance
VarianceTermPtr<'a>
&mut self
def_id
ast::DefId
generics
&ty::Generics
substs
&ty::substs
variance
VarianceTermPtr<'a>