pub fn is_subregion_of(&self,
                           sub_region: ty::Region<'tcx>,
                           super_region: ty::Region<'tcx>)
                           -> bool {
        let result = sub_region == super_region || {
            match (sub_region, super_region) {
                (&ty::ReEmpty, _) |
                (_, &ty::ReStatic) =>
                    true,

                (&ty::ReScope(sub_scope), &ty::ReScope(super_scope)) =>
                    self.region_maps.is_subscope_of(sub_scope, super_scope),

                (&ty::ReScope(sub_scope), &ty::ReEarlyBound(ref br)) => {
                    let fr_scope = self.region_maps.early_free_extent(self.tcx, br);
                    self.region_maps.is_subscope_of(sub_scope, fr_scope)
                }

                (&ty::ReScope(sub_scope), &ty::ReFree(ref fr)) => {
                    let fr_scope = self.region_maps.free_extent(self.tcx, fr);
                    self.region_maps.is_subscope_of(sub_scope, fr_scope)
                }

                (&ty::ReEarlyBound(_), &ty::ReEarlyBound(_)) |
                (&ty::ReFree(_), &ty::ReEarlyBound(_)) |
                (&ty::ReEarlyBound(_), &ty::ReFree(_)) |
                (&ty::ReFree(_), &ty::ReFree(_)) =>
                    self.free_regions.relation.contains(&sub_region, &super_region),

                _ =>
                    false,
            }
        };
        let result = result || self.is_static(super_region);
        debug!("is_subregion_of(sub_region={:?}, super_region={:?}) = {:?}",
               sub_region, super_region, result);
        result
    }
/// Determines whether one region is a subregion of another.  This is intended to run *after
/// inference* and sadly the logic is somewhat duplicated with the code in infer.rs.
Determines whether one region is a subregion of another.  This is intended to run *after
inference* and sadly the logic is somewhat duplicated with the code in infer.rs.
Determines whether one region is a subregion of another . This is intended to run * after inference * and sadly the logic is somewhat duplicated with the code in infer . rs .
pub fn is_subregion_of(&self,
                           sub_region: ty::Region<'tcx>,
                           super_region: ty::Region<'tcx>)
                           -> bool {
        let result = sub_region == super_region || {
            match (sub_region, super_region) {
                (&ty::ReEmpty, _) |
                (_, &ty::ReStatic) =>
                    true,
                (&ty::ReScope(sub_scope), &ty::ReScope(super_scope)) =>
                    self.region_maps.is_subscope_of(sub_scope, super_scope),
                (&ty::ReScope(sub_scope), &ty::ReEarlyBound(ref br)) => {
                    let fr_scope = self.region_maps.early_free_extent(self.tcx, br);
                    self.region_maps.is_subscope_of(sub_scope, fr_scope)
                }
                (&ty::ReScope(sub_scope), &ty::ReFree(ref fr)) => {
                    let fr_scope = self.region_maps.free_extent(self.tcx, fr);
                    self.region_maps.is_subscope_of(sub_scope, fr_scope)
                }
                (&ty::ReEarlyBound(_), &ty::ReEarlyBound(_)) |
                (&ty::ReFree(_), &ty::ReEarlyBound(_)) |
                (&ty::ReEarlyBound(_), &ty::ReFree(_)) |
                (&ty::ReFree(_), &ty::ReFree(_)) =>
                    self.free_regions.relation.contains(&sub_region, &super_region),
                _ =>
                    false,
            }
        };
        let result = result || self.is_static(super_region);
        debug!("is_subregion_of(sub_region={:?}, super_region={:?}) = {:?}",
               sub_region, super_region, result);
        result
    }
pub fn is_subregion_of ( & self , sub_region : ty :: Region < ' tcx > , super_region : ty :: Region < ' tcx > ) -> bool { let result = sub_region == super_region || { match ( sub_region , super_region ) { ( & ty :: ReEmpty , _ ) | ( _ , & ty :: ReStatic ) => true , ( & ty :: ReScope ( sub_scope ) , & ty :: ReScope ( super_scope ) ) => self . region_maps . is_subscope_of ( sub_scope , super_scope ) , ( & ty :: ReScope ( sub_scope ) , & ty :: ReEarlyBound ( ref br ) ) => { let fr_scope = self . region_maps . early_free_extent ( self . tcx , br ) ; self . region_maps . is_subscope_of ( sub_scope , fr_scope ) } ( & ty :: ReScope ( sub_scope ) , & ty :: ReFree ( ref fr ) ) => { let fr_scope = self . region_maps . free_extent ( self . tcx , fr ) ; self . region_maps . is_subscope_of ( sub_scope , fr_scope ) } ( & ty :: ReEarlyBound ( _ ) , & ty :: ReEarlyBound ( _ ) ) | ( & ty :: ReFree ( _ ) , & ty :: ReEarlyBound ( _ ) ) | ( & ty :: ReEarlyBound ( _ ) , & ty :: ReFree ( _ ) ) | ( & ty :: ReFree ( _ ) , & ty :: ReFree ( _ ) ) => self . free_regions . relation . contains ( & sub_region , & super_region ) , _ => false , } } ; let result = result || self . is_static ( super_region ) ; debug ! ( " " sub_region super_region result ) ; result }
Determines whether one region is a subregion of another.
Determines whether one region is a subregion of another .
&self
sub_region
ty::Region<'tcx>
super_region
ty::Region<'tcx>
&self
sub_region
ty::Region<'tcx>
super_region
ty::Region<'tcx>