Trait rustc_utils::hir::ty::TyExt

source ·
pub trait TyExt<'tcx> {
    type AllRegionsIter<'a>: Iterator<Item = Region<'tcx>>
       where Self: 'a;

    // Required methods
    fn inner_regions(&self) -> Self::AllRegionsIter<'_>;
    fn does_implement_trait(
        &self,
        tcx: TyCtxt<'tcx>,
        param_env: ParamEnv<'tcx>,
        trait_def_id: DefId
    ) -> bool;
    fn is_copyable(&self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> bool;
}
Expand description

Extension trait for Ty.

Required Associated Types§

source

type AllRegionsIter<'a>: Iterator<Item = Region<'tcx>> where Self: 'a

Required Methods§

source

fn inner_regions(&self) -> Self::AllRegionsIter<'_>

Returns an iterator over the regions appearing within a type.

source

fn does_implement_trait( &self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, trait_def_id: DefId ) -> bool

Returns true if a type implements a given trait.

source

fn is_copyable(&self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> bool

Returns true if a type implements Copy.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'tcx> TyExt<'tcx> for Ty<'tcx>

§

type AllRegionsIter<'a> = impl Iterator<Item = Region<'tcx>> + Captures<'tcx> + 'a where Self: 'a

source§

fn inner_regions(&self) -> Self::AllRegionsIter<'_>

source§

fn does_implement_trait( &self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, trait_def_id: DefId ) -> bool

source§

fn is_copyable(&self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> bool

Implementors§