rustc_trait_selection::infer::canonical::ir::inherent

Trait AdtDef

Source
pub trait AdtDef<I>:
    Copy
    + Debug
    + Hash
    + Eq
where I: Interner,
{ // Required methods fn def_id(self) -> <I as Interner>::DefId; fn is_struct(self) -> bool; fn struct_tail_ty( self, interner: I, ) -> Option<EarlyBinder<I, <I as Interner>::Ty>>; fn is_phantom_data(self) -> bool; fn all_field_tys( self, interner: I, ) -> EarlyBinder<I, impl IntoIterator<Item = <I as Interner>::Ty>>; fn sized_constraint( self, interner: I, ) -> Option<EarlyBinder<I, <I as Interner>::Ty>>; fn is_fundamental(self) -> bool; }

Required Methods§

Source

fn def_id(self) -> <I as Interner>::DefId

Source

fn is_struct(self) -> bool

Source

fn struct_tail_ty( self, interner: I, ) -> Option<EarlyBinder<I, <I as Interner>::Ty>>

Returns the type of the struct tail.

Expects the AdtDef to be a struct. If it is not, then this will panic.

Source

fn is_phantom_data(self) -> bool

Source

fn all_field_tys( self, interner: I, ) -> EarlyBinder<I, impl IntoIterator<Item = <I as Interner>::Ty>>

Source

fn sized_constraint( self, interner: I, ) -> Option<EarlyBinder<I, <I as Interner>::Ty>>

Source

fn is_fundamental(self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'tcx> AdtDef<TyCtxt<'tcx>> for AdtDef<'tcx>

Source§

fn def_id(self) -> DefId

Source§

fn is_struct(self) -> bool

Source§

fn struct_tail_ty( self, interner: TyCtxt<'tcx>, ) -> Option<EarlyBinder<TyCtxt<'tcx>, Ty<'tcx>>>

Source§

fn is_phantom_data(self) -> bool

Source§

fn all_field_tys( self, tcx: TyCtxt<'tcx>, ) -> EarlyBinder<TyCtxt<'tcx>, impl IntoIterator<Item = Ty<'tcx>>>

Source§

fn sized_constraint( self, tcx: TyCtxt<'tcx>, ) -> Option<EarlyBinder<TyCtxt<'tcx>, Ty<'tcx>>>

Source§

fn is_fundamental(self) -> bool

Implementors§