Skip to main content

Ty

pub trait Ty<I>:
    Copy
    + Debug
    + Hash
    + Eq
    + Into<<I as Interner>::GenericArg>
    + Into<<I as Interner>::Term>
    + IntoKind<Kind = TyKind<I>>
    + TypeSuperVisitable<I>
    + TypeSuperFoldable<I>
    + Relate<I>
    + Flags
where I: Interner<Ty = Self>,
{
Show 47 methods // Required methods fn new_unit(interner: I) -> Self; fn new_bool(interner: I) -> Self; fn new_u8(interner: I) -> Self; fn new_usize(interner: I) -> Self; fn new_infer(interner: I, var: InferTy) -> Self; fn new_var(interner: I, var: TyVid) -> Self; fn new_param(interner: I, param: <I as Interner>::ParamTy) -> Self; fn new_placeholder(interner: I, param: Placeholder<I, BoundTy<I>>) -> Self; fn new_bound(interner: I, debruijn: DebruijnIndex, var: BoundTy<I>) -> Self; fn new_anon_bound( interner: I, debruijn: DebruijnIndex, var: BoundVar, ) -> Self; fn new_canonical_bound(interner: I, var: BoundVar) -> Self; fn new_alias(interner: I, alias_ty: AliasTy<I>) -> Self; fn new_error(interner: I, guar: <I as Interner>::ErrorGuaranteed) -> Self; fn new_adt( interner: I, adt_def: <I as Interner>::AdtDef, args: <I as Interner>::GenericArgs, ) -> Self; fn new_foreign(interner: I, def_id: <I as Interner>::ForeignId) -> Self; fn new_dynamic( interner: I, preds: <I as Interner>::BoundExistentialPredicates, region: <I as Interner>::Region, ) -> Self; fn new_coroutine( interner: I, def_id: <I as Interner>::CoroutineId, args: <I as Interner>::GenericArgs, ) -> Self; fn new_coroutine_closure( interner: I, def_id: <I as Interner>::CoroutineClosureId, args: <I as Interner>::GenericArgs, ) -> Self; fn new_closure( interner: I, def_id: <I as Interner>::ClosureId, args: <I as Interner>::GenericArgs, ) -> Self; fn new_coroutine_witness( interner: I, def_id: <I as Interner>::CoroutineId, args: <I as Interner>::GenericArgs, ) -> Self; fn new_coroutine_witness_for_coroutine( interner: I, def_id: <I as Interner>::CoroutineId, coroutine_args: <I as Interner>::GenericArgs, ) -> Self; fn new_ptr(interner: I, ty: Self, mutbl: Mutability) -> Self; fn new_ref( interner: I, region: <I as Interner>::Region, ty: Self, mutbl: Mutability, ) -> Self; fn new_array_with_const_len( interner: I, ty: Self, len: <I as Interner>::Const, ) -> Self; fn new_slice(interner: I, ty: Self) -> Self; fn new_tup(interner: I, tys: &[Self]) -> Self; fn new_tup_from_iter<It, T>( interner: I, iter: It, ) -> <T as CollectAndApply<Self, Self>>::Output where It: Iterator<Item = T>, T: CollectAndApply<Self, Self>; fn new_fn_def( interner: I, def_id: <I as Interner>::FunctionId, args: <I as Interner>::GenericArgs, ) -> Self; fn new_fn_ptr(interner: I, sig: Binder<I, FnSig<I>>) -> Self; fn new_pat(interner: I, ty: Self, pat: <I as Interner>::Pat) -> Self; fn new_unsafe_binder(interner: I, ty: Binder<I, Self>) -> Self; fn tuple_fields(self) -> <I as Interner>::Tys; fn to_opt_closure_kind(self) -> Option<ClosureKind>; fn from_closure_kind(interner: I, kind: ClosureKind) -> Self; fn from_coroutine_closure_kind(interner: I, kind: ClosureKind) -> Self; fn has_unsafe_fields(self) -> bool; fn discriminant_ty(self, interner: I) -> Self; // Provided methods fn new_projection_from_args( interner: I, def_id: <I as Interner>::TraitAssocTyId, args: <I as Interner>::GenericArgs, ) -> Self { ... } fn new_projection( interner: I, def_id: <I as Interner>::TraitAssocTyId, args: impl IntoIterator>, ) -> Self where <impl IntoIterator as IntoIterator>::Item: Into<<I as Interner>::GenericArg> { ... } fn is_ty_var(self) -> bool { ... } fn is_ty_error(self) -> bool { ... } fn is_floating_point(self) -> bool { ... } fn is_integral(self) -> bool { ... } fn is_fn_ptr(self) -> bool { ... } fn fn_sig(self, interner: I) -> Binder<I, FnSig<I>> { ... } fn is_known_rigid(self) -> bool { ... } fn is_guaranteed_unsized_raw(self) -> bool { ... }
}

Required Methods§

Source

fn new_unit(interner: I) -> Self

Source

fn new_bool(interner: I) -> Self

Source

fn new_u8(interner: I) -> Self

Source

fn new_usize(interner: I) -> Self

Source

fn new_infer(interner: I, var: InferTy) -> Self

Source

fn new_var(interner: I, var: TyVid) -> Self

Source

fn new_param(interner: I, param: <I as Interner>::ParamTy) -> Self

Source

fn new_placeholder(interner: I, param: Placeholder<I, BoundTy<I>>) -> Self

Source

fn new_bound(interner: I, debruijn: DebruijnIndex, var: BoundTy<I>) -> Self

Source

fn new_anon_bound(interner: I, debruijn: DebruijnIndex, var: BoundVar) -> Self

Source

fn new_canonical_bound(interner: I, var: BoundVar) -> Self

Source

fn new_alias(interner: I, alias_ty: AliasTy<I>) -> Self

Source

fn new_error(interner: I, guar: <I as Interner>::ErrorGuaranteed) -> Self

Source

fn new_adt( interner: I, adt_def: <I as Interner>::AdtDef, args: <I as Interner>::GenericArgs, ) -> Self

Source

fn new_foreign(interner: I, def_id: <I as Interner>::ForeignId) -> Self

Source

fn new_dynamic( interner: I, preds: <I as Interner>::BoundExistentialPredicates, region: <I as Interner>::Region, ) -> Self

Source

fn new_coroutine( interner: I, def_id: <I as Interner>::CoroutineId, args: <I as Interner>::GenericArgs, ) -> Self

Source

fn new_coroutine_closure( interner: I, def_id: <I as Interner>::CoroutineClosureId, args: <I as Interner>::GenericArgs, ) -> Self

Source

fn new_closure( interner: I, def_id: <I as Interner>::ClosureId, args: <I as Interner>::GenericArgs, ) -> Self

Source

fn new_coroutine_witness( interner: I, def_id: <I as Interner>::CoroutineId, args: <I as Interner>::GenericArgs, ) -> Self

Source

fn new_coroutine_witness_for_coroutine( interner: I, def_id: <I as Interner>::CoroutineId, coroutine_args: <I as Interner>::GenericArgs, ) -> Self

Source

fn new_ptr(interner: I, ty: Self, mutbl: Mutability) -> Self

Source

fn new_ref( interner: I, region: <I as Interner>::Region, ty: Self, mutbl: Mutability, ) -> Self

Source

fn new_array_with_const_len( interner: I, ty: Self, len: <I as Interner>::Const, ) -> Self

Source

fn new_slice(interner: I, ty: Self) -> Self

Source

fn new_tup(interner: I, tys: &[Self]) -> Self

Source

fn new_tup_from_iter<It, T>( interner: I, iter: It, ) -> <T as CollectAndApply<Self, Self>>::Output
where It: Iterator<Item = T>, T: CollectAndApply<Self, Self>,

Source

fn new_fn_def( interner: I, def_id: <I as Interner>::FunctionId, args: <I as Interner>::GenericArgs, ) -> Self

Source

fn new_fn_ptr(interner: I, sig: Binder<I, FnSig<I>>) -> Self

Source

fn new_pat(interner: I, ty: Self, pat: <I as Interner>::Pat) -> Self

Source

fn new_unsafe_binder(interner: I, ty: Binder<I, Self>) -> Self

Source

fn tuple_fields(self) -> <I as Interner>::Tys

Source

fn to_opt_closure_kind(self) -> Option<ClosureKind>

Source

fn from_closure_kind(interner: I, kind: ClosureKind) -> Self

Source

fn from_coroutine_closure_kind(interner: I, kind: ClosureKind) -> Self

Source

fn has_unsafe_fields(self) -> bool

Checks whether this type is an ADT that has unsafe fields.

Source

fn discriminant_ty(self, interner: I) -> Self

Provided Methods§

Source

fn new_projection_from_args( interner: I, def_id: <I as Interner>::TraitAssocTyId, args: <I as Interner>::GenericArgs, ) -> Self

Source

fn new_projection( interner: I, def_id: <I as Interner>::TraitAssocTyId, args: impl IntoIterator>, ) -> Self

Source

fn is_ty_var(self) -> bool

Source

fn is_ty_error(self) -> bool

Source

fn is_floating_point(self) -> bool

Source

fn is_integral(self) -> bool

Source

fn is_fn_ptr(self) -> bool

Source

fn fn_sig(self, interner: I) -> Binder<I, FnSig<I>>

Source

fn is_known_rigid(self) -> bool

Source

fn is_guaranteed_unsized_raw(self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'tcx> Ty<TyCtxt<'tcx>> for Ty<'tcx>

Source§

fn new_bool(tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Source§

fn new_u8(tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Source§

fn new_infer(tcx: TyCtxt<'tcx>, infer: InferTy) -> Ty<'tcx>

Source§

fn new_var(tcx: TyCtxt<'tcx>, vid: TyVid) -> Ty<'tcx>

Source§

fn new_param(tcx: TyCtxt<'tcx>, param: ParamTy) -> Ty<'tcx>

Source§

fn new_placeholder( tcx: TyCtxt<'tcx>, placeholder: Placeholder<TyCtxt<'tcx>, BoundTy<TyCtxt<'tcx>>>, ) -> Ty<'tcx>

Source§

fn new_bound( interner: TyCtxt<'tcx>, debruijn: DebruijnIndex, var: BoundTy<TyCtxt<'tcx>>, ) -> Ty<'tcx>

Source§

fn new_anon_bound( tcx: TyCtxt<'tcx>, debruijn: DebruijnIndex, var: BoundVar, ) -> Ty<'tcx>

Source§

fn new_canonical_bound(tcx: TyCtxt<'tcx>, var: BoundVar) -> Ty<'tcx>

Source§

fn new_alias( interner: TyCtxt<'tcx>, alias_ty: AliasTy<TyCtxt<'tcx>>, ) -> Ty<'tcx>

Source§

fn new_error(interner: TyCtxt<'tcx>, guar: ErrorGuaranteed) -> Ty<'tcx>

Source§

fn new_adt( interner: TyCtxt<'tcx>, adt_def: AdtDef<'tcx>, args: &'tcx RawList<(), GenericArg<'tcx>>, ) -> Ty<'tcx>

Source§

fn new_foreign(interner: TyCtxt<'tcx>, def_id: DefId) -> Ty<'tcx>

Source§

fn new_dynamic( interner: TyCtxt<'tcx>, preds: &'tcx RawList<(), Binder<TyCtxt<'tcx>, ExistentialPredicate<TyCtxt<'tcx>>>>, region: Region<'tcx>, ) -> Ty<'tcx>

Source§

fn new_coroutine( interner: TyCtxt<'tcx>, def_id: DefId, args: &'tcx RawList<(), GenericArg<'tcx>>, ) -> Ty<'tcx>

Source§

fn new_coroutine_closure( interner: TyCtxt<'tcx>, def_id: DefId, args: &'tcx RawList<(), GenericArg<'tcx>>, ) -> Ty<'tcx>

Source§

fn new_closure( interner: TyCtxt<'tcx>, def_id: DefId, args: &'tcx RawList<(), GenericArg<'tcx>>, ) -> Ty<'tcx>

Source§

fn new_coroutine_witness( interner: TyCtxt<'tcx>, def_id: DefId, args: &'tcx RawList<(), GenericArg<'tcx>>, ) -> Ty<'tcx>

Source§

fn new_coroutine_witness_for_coroutine( interner: TyCtxt<'tcx>, def_id: DefId, coroutine_args: &'tcx RawList<(), GenericArg<'tcx>>, ) -> Ty<'tcx>

Source§

fn new_ptr(interner: TyCtxt<'tcx>, ty: Ty<'tcx>, mutbl: Mutability) -> Ty<'tcx>

Source§

fn new_ref( interner: TyCtxt<'tcx>, region: Region<'tcx>, ty: Ty<'tcx>, mutbl: Mutability, ) -> Ty<'tcx>

Source§

fn new_array_with_const_len( interner: TyCtxt<'tcx>, ty: Ty<'tcx>, len: Const<'tcx>, ) -> Ty<'tcx>

Source§

fn new_slice(interner: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx>

Source§

fn new_tup(interner: TyCtxt<'tcx>, tys: &[Ty<'tcx>]) -> Ty<'tcx>

Source§

fn new_tup_from_iter<It, T>( interner: TyCtxt<'tcx>, iter: It, ) -> <T as CollectAndApply<Ty<'tcx>, Ty<'tcx>>>::Output
where It: Iterator<Item = T>, T: CollectAndApply<Ty<'tcx>, Ty<'tcx>>,

Source§

fn tuple_fields(self) -> &'tcx RawList<(), Ty<'tcx>>

Source§

fn to_opt_closure_kind(self) -> Option<ClosureKind>

Source§

fn from_closure_kind(interner: TyCtxt<'tcx>, kind: ClosureKind) -> Ty<'tcx>

Source§

fn from_coroutine_closure_kind( interner: TyCtxt<'tcx>, kind: ClosureKind, ) -> Ty<'tcx>

Source§

fn new_fn_def( interner: TyCtxt<'tcx>, def_id: DefId, args: &'tcx RawList<(), GenericArg<'tcx>>, ) -> Ty<'tcx>

Source§

fn new_fn_ptr( interner: TyCtxt<'tcx>, sig: Binder<TyCtxt<'tcx>, FnSig<TyCtxt<'tcx>>>, ) -> Ty<'tcx>

Source§

fn new_pat(interner: TyCtxt<'tcx>, ty: Ty<'tcx>, pat: Pattern<'tcx>) -> Ty<'tcx>

Source§

fn new_unsafe_binder( interner: TyCtxt<'tcx>, ty: Binder<TyCtxt<'tcx>, Ty<'tcx>>, ) -> Ty<'tcx>

Source§

fn new_unit(interner: TyCtxt<'tcx>) -> Ty<'tcx>

Source§

fn new_usize(interner: TyCtxt<'tcx>) -> Ty<'tcx>

Source§

fn discriminant_ty(self, interner: TyCtxt<'tcx>) -> Ty<'tcx>

Source§

fn has_unsafe_fields(self) -> bool

Implementors§