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§
type AllRegionsIter<'a>: Iterator<Item = Region<'tcx>> where Self: 'a
Required Methods§
sourcefn inner_regions(&self) -> Self::AllRegionsIter<'_>
fn inner_regions(&self) -> Self::AllRegionsIter<'_>
Returns an iterator over the regions appearing within a type.
sourcefn does_implement_trait(
&self,
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
trait_def_id: DefId
) -> bool
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.
sourcefn is_copyable(&self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> bool
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.