pub fn is_suitable_region(&self, region: Region<'tcx>) -> Option<FreeRegionInfo> {
        let (suitable_region_binding_scope, bound_region) = match *region {
            ty::ReFree(ref free_region) => {
                (free_region.scope.expect_local(), free_region.bound_region)
            }
            ty::ReEarlyBound(ref ebr) => (
                self.parent(ebr.def_id).unwrap().expect_local(),
                ty::BoundRegion::BrNamed(ebr.def_id, ebr.name),
            ),
            _ => return None, // not a free region
        };

        let hir_id = self.hir().as_local_hir_id(suitable_region_binding_scope);
        let is_impl_item = match self.hir().find(hir_id) {
            Some(Node::Item(..) | Node::TraitItem(..)) => false,
            Some(Node::ImplItem(..)) => {
                self.is_bound_region_in_impl_item(suitable_region_binding_scope)
            }
            _ => return None,
        };

        Some(FreeRegionInfo {
            def_id: suitable_region_binding_scope,
            boundregion: bound_region,
            is_impl_item,
        })
    }
// Returns the `DefId` and the `BoundRegion` corresponding to the given region.
Returns the `DefId` and the `BoundRegion` corresponding to the given region.
Returns the ` DefId ` and the ` BoundRegion ` corresponding to the given region .
pub fn is_suitable_region(&self, region: Region<'tcx>) -> Option<FreeRegionInfo> {
        let (suitable_region_binding_scope, bound_region) = match *region {
            ty::ReFree(ref free_region) => {
                (free_region.scope.expect_local(), free_region.bound_region)
            }
            ty::ReEarlyBound(ref ebr) => (
                self.parent(ebr.def_id).unwrap().expect_local(),
                ty::BoundRegion::BrNamed(ebr.def_id, ebr.name),
            ),
            _ => return None, // not a free region
        };
        let hir_id = self.hir().as_local_hir_id(suitable_region_binding_scope);
        let is_impl_item = match self.hir().find(hir_id) {
            Some(Node::Item(..) | Node::TraitItem(..)) => false,
            Some(Node::ImplItem(..)) => {
                self.is_bound_region_in_impl_item(suitable_region_binding_scope)
            }
            _ => return None,
        };
        Some(FreeRegionInfo {
            def_id: suitable_region_binding_scope,
            boundregion: bound_region,
            is_impl_item,
        })
    }
pub fn is_suitable_region ( & self , region : Region < ' tcx > ) -> Option < FreeRegionInfo > { let ( suitable_region_binding_scope , bound_region ) = match * region { ty :: ReFree ( ref free_region ) => { ( free_region . scope . expect_local ( ) , free_region . bound_region ) } ty :: ReEarlyBound ( ref ebr ) => ( self . parent ( ebr . def_id ) . unwrap ( ) . expect_local ( ) , ty :: BoundRegion :: BrNamed ( ebr . def_id , ebr . name ) , ) , _ => return None , // not a free region } ; let hir_id = self . hir ( ) . as_local_hir_id ( suitable_region_binding_scope ) ; let is_impl_item = match self . hir ( ) . find ( hir_id ) { Some ( Node :: Item ( .. ) | Node :: TraitItem ( .. ) ) => false , Some ( Node :: ImplItem ( .. ) ) => { self . is_bound_region_in_impl_item ( suitable_region_binding_scope ) } _ => return None , } ; Some ( FreeRegionInfo { def_id : suitable_region_binding_scope , boundregion : bound_region , is_impl_item , } ) }
Returns the `DefId` and the `BoundRegion` corresponding to the given region.
Returns the ` DefId ` and the ` BoundRegion ` corresponding to the given region .
&self
region
Region<'tcx>
&self
region
Region<'tcx>