fn add_constraints_from_region(&mut self,
                                   region: ty::Region,
                                   variance: VarianceTermPtr<'a>) {
        match region {
            ty::ReEarlyBound(param_id, _, _) => {
                let index = self.inferred_index(param_id);
                self.add_constraint(index, variance);
            }

            ty::ReStatic => { }

            ty::ReLateBound(..) => {
                // We do not infer variance for region parameters on
                // methods or in fn types.
            }

            ty::ReFree(..) | ty::ReScope(..) | ty::ReInfer(..) |
            ty::ReEmpty => {
                // We don't expect to see anything but 'static or bound
                // regions when visiting member types or method types.
                self.tcx().sess.bug(format!("Unexpected region encountered in \
                                            variance inference: {}",
                                            region.repr(self.tcx())));
            }
        }
    }
/// Adds constraints appropriate for a region appearing in a
/// context with ambient variance `variance`
Adds constraints appropriate for a region appearing in a
context with ambient variance `variance`
Adds constraints appropriate for a region appearing in a context with ambient variance ` variance `
fn add_constraints_from_region(&mut self,
                                   region: ty::Region,
                                   variance: VarianceTermPtr<'a>) {
        match region {
            ty::ReEarlyBound(param_id, _, _) => {
                let index = self.inferred_index(param_id);
                self.add_constraint(index, variance);
            }
            ty::ReStatic => { }
            ty::ReLateBound(..) => {
                // We do not infer variance for region parameters on
                // methods or in fn types.
            }
            ty::ReFree(..) | ty::ReScope(..) | ty::ReInfer(..) |
            ty::ReEmpty => {
                // We don't expect to see anything but 'static or bound
                // regions when visiting member types or method types.
                self.tcx().sess.bug(format!("Unexpected region encountered in \
                                            variance inference: {}",
                                            region.repr(self.tcx())));
            }
        }
    }
fn add_constraints_from_region ( & mut self , region : ty :: Region , variance : VarianceTermPtr < ' a > ) { match region { ty :: ReEarlyBound ( param_id , _ , _ ) => { let index = self . inferred_index ( param_id ) ; self . add_constraint ( index , variance ) ; } ty :: ReStatic => { } ty :: ReLateBound ( .. ) => { // We do not infer variance for region parameters on // methods or in fn types. } ty :: ReFree ( .. ) | ty :: ReScope ( .. ) | ty :: ReInfer ( .. ) | ty :: ReEmpty => { // We don't expect to see anything but 'static or bound // regions when visiting member types or method types. self . tcx ( ) . sess . bug ( format ! ( " \
 " region repr ( self tcx ( ) ) ) ) ; } } }
Adds constraints appropriate for a region appearing in a
context with ambient variance `variance`
Adds constraints appropriate for a region appearing in a context with ambient variance ` variance `
&mut self
region
ty::Region
variance
VarianceTermPtr<'a>
&mut self
region
ty::Region
variance
VarianceTermPtr<'a>