pub fn regions(&self) -> Vec<ty::Region> {
        match self.sty {
            TyRef(region, _) => {
                vec![*region]
            }
            TyTrait(ref obj) => {
                let mut v = vec![obj.bounds.region_bound];
                v.push_all(obj.principal.skip_binder().substs.regions().as_slice());
                v
            }
            TyEnum(_, substs) |
            TyStruct(_, substs) => {
                substs.regions().as_slice().to_vec()
            }
            TyClosure(_, ref substs) => {
                substs.func_substs.regions().as_slice().to_vec()
            }
            TyProjection(ref data) => {
                data.trait_ref.substs.regions().as_slice().to_vec()
            }
            TyBareFn(..) |
            TyBool |
            TyChar |
            TyInt(_) |
            TyUint(_) |
            TyFloat(_) |
            TyBox(_) |
            TyStr |
            TyArray(_, _) |
            TySlice(_) |
            TyRawPtr(_) |
            TyTuple(_) |
            TyParam(_) |
            TyInfer(_) |
            TyError => {
                vec![]
            }
        }
    }
/// Returns the regions directly referenced from this type (but
/// not types reachable from this type via `walk_tys`). This
/// ignores late-bound regions binders.
Returns the regions directly referenced from this type (but
not types reachable from this type via `walk_tys`). This
ignores late-bound regions binders.
Returns the regions directly referenced from this type ( but not types reachable from this type via ` walk_tys ` ) . This ignores late - bound regions binders .
pub fn regions(&self) -> Vec<ty::Region> {
        match self.sty {
            TyRef(region, _) => {
                vec![*region]
            }
            TyTrait(ref obj) => {
                let mut v = vec![obj.bounds.region_bound];
                v.push_all(obj.principal.skip_binder().substs.regions().as_slice());
                v
            }
            TyEnum(_, substs) |
            TyStruct(_, substs) => {
                substs.regions().as_slice().to_vec()
            }
            TyClosure(_, ref substs) => {
                substs.func_substs.regions().as_slice().to_vec()
            }
            TyProjection(ref data) => {
                data.trait_ref.substs.regions().as_slice().to_vec()
            }
            TyBareFn(..) |
            TyBool |
            TyChar |
            TyInt(_) |
            TyUint(_) |
            TyFloat(_) |
            TyBox(_) |
            TyStr |
            TyArray(_, _) |
            TySlice(_) |
            TyRawPtr(_) |
            TyTuple(_) |
            TyParam(_) |
            TyInfer(_) |
            TyError => {
                vec![]
            }
        }
    }
pub fn regions ( & self ) -> Vec < ty :: Region > { match self . sty { TyRef ( region , _ ) => { vec ! [ region ] } TyTrait ( ref obj ) => { let mut v = vec ! [ obj bounds region_bound ] ; v . push_all ( obj . principal . skip_binder ( ) . substs . regions ( ) . as_slice ( ) ) ; v } TyEnum ( _ , substs ) | TyStruct ( _ , substs ) => { substs . regions ( ) . as_slice ( ) . to_vec ( ) } TyClosure ( _ , ref substs ) => { substs . func_substs . regions ( ) . as_slice ( ) . to_vec ( ) } TyProjection ( ref data ) => { data . trait_ref . substs . regions ( ) . as_slice ( ) . to_vec ( ) } TyBareFn ( .. ) | TyBool | TyChar | TyInt ( _ ) | TyUint ( _ ) | TyFloat ( _ ) | TyBox ( _ ) | TyStr | TyArray ( _ , _ ) | TySlice ( _ ) | TyRawPtr ( _ ) | TyTuple ( _ ) | TyParam ( _ ) | TyInfer ( _ ) | TyError => { vec ! [ ] } } }
Returns the regions directly referenced from this type (but
not types reachable from this type via `walk_tys`).
Returns the regions directly referenced from this type ( but not types reachable from this type via ` walk_tys ` ) .
&self
&self