pub fn regions(&self) -> Vec<ty::Region<'tcx>> {
        match self.sty {
            TyRef(region, _, _) => {
                vec![region]
            }
            TyDynamic(ref obj, region) => {
                let mut v = vec![region];
                if let Some(p) = obj.principal() {
                    v.extend(p.skip_binder().substs.regions());
                }
                v
            }
            TyAdt(_, substs) | TyAnon(_, substs) => {
                substs.regions().collect()
            }
            TyClosure(_, ClosureSubsts { ref substs }) |
            TyGenerator(_, GeneratorSubsts { ref substs }, _) => {
                substs.regions().collect()
            }
            TyProjection(ref data) => {
                data.substs.regions().collect()
            }
            TyFnDef(..) |
            TyFnPtr(_) |
            TyGeneratorWitness(..) |
            TyBool |
            TyChar |
            TyInt(_) |
            TyUint(_) |
            TyFloat(_) |
            TyStr |
            TyArray(..) |
            TySlice(_) |
            TyRawPtr(_) |
            TyNever |
            TyTuple(..) |
            TyForeign(..) |
            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<'tcx>> {
        match self.sty {
            TyRef(region, _, _) => {
                vec![region]
            }
            TyDynamic(ref obj, region) => {
                let mut v = vec![region];
                if let Some(p) = obj.principal() {
                    v.extend(p.skip_binder().substs.regions());
                }
                v
            }
            TyAdt(_, substs) | TyAnon(_, substs) => {
                substs.regions().collect()
            }
            TyClosure(_, ClosureSubsts { ref substs }) |
            TyGenerator(_, GeneratorSubsts { ref substs }, _) => {
                substs.regions().collect()
            }
            TyProjection(ref data) => {
                data.substs.regions().collect()
            }
            TyFnDef(..) |
            TyFnPtr(_) |
            TyGeneratorWitness(..) |
            TyBool |
            TyChar |
            TyInt(_) |
            TyUint(_) |
            TyFloat(_) |
            TyStr |
            TyArray(..) |
            TySlice(_) |
            TyRawPtr(_) |
            TyNever |
            TyTuple(..) |
            TyForeign(..) |
            TyParam(_) |
            TyInfer(_) |
            TyError => {
                vec![]
            }
        }
    }
pub fn regions ( & self ) -> Vec < ty :: Region < ' tcx > > { match self . sty { TyRef ( region , _ , _ ) => { vec ! [ region ] } TyDynamic ( ref obj , region ) => { let mut v = vec ! [ region ] ; if let Some ( p ) = obj . principal ( ) { v . extend ( p . skip_binder ( ) . substs . regions ( ) ) ; } v } TyAdt ( _ , substs ) | TyAnon ( _ , substs ) => { substs . regions ( ) . collect ( ) } TyClosure ( _ , ClosureSubsts { ref substs } ) | TyGenerator ( _ , GeneratorSubsts { ref substs } , _ ) => { substs . regions ( ) . collect ( ) } TyProjection ( ref data ) => { data . substs . regions ( ) . collect ( ) } TyFnDef ( .. ) | TyFnPtr ( _ ) | TyGeneratorWitness ( .. ) | TyBool | TyChar | TyInt ( _ ) | TyUint ( _ ) | TyFloat ( _ ) | TyStr | TyArray ( .. ) | TySlice ( _ ) | TyRawPtr ( _ ) | TyNever | TyTuple ( .. ) | TyForeign ( .. ) | 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