pub struct Ctor<'tcx> {
def_id: DefId,
args: GenericArgsRef<'tcx>,
rustc_sig: PolyFnSig<'tcx>,
adt_def_id: DefId,
ctor_of: CtorOf,
variant_id: VariantIdx,
fields: IndexVec<FieldIdx, FieldDef<'tcx>>,
output_ty: Ty<'tcx>,
sig: PolyFnSig<'tcx>,
fn_trait_impls: OnceCell<Option<FnTraitImpls<'tcx>>>,
}Expand description
The constructor function of a tuple/unit struct or tuple/unit enum variant.
Fields§
§def_id: DefId§args: GenericArgsRef<'tcx>§rustc_sig: PolyFnSig<'tcx>The signature, instantiated with args.
adt_def_id: DefId§ctor_of: CtorOf§variant_id: VariantIdx§fields: IndexVec<FieldIdx, FieldDef<'tcx>>§output_ty: Ty<'tcx>§sig: PolyFnSig<'tcx>§fn_trait_impls: OnceCell<Option<FnTraitImpls<'tcx>>>Computed on demand, see Ctor::fn_trait_impls.
Implementations§
Source§impl<'tcx> Ctor<'tcx>
impl<'tcx> Ctor<'tcx>
pub fn adt_def_id(&self) -> &DefId
pub fn ctor_of(&self) -> CtorOf
pub fn variant_id(&self) -> VariantIdx
pub fn fields(&self) -> &IndexVec<FieldIdx, FieldDef<'tcx>>
pub fn output_ty(&self) -> &Ty<'tcx>
pub fn sig(&self) -> &PolyFnSig<'tcx>
Sourcepub fn fn_trait_impls(
&self,
s: &impl BaseState<'tcx>,
) -> Option<&FnTraitImpls<'tcx>>
pub fn fn_trait_impls( &self, s: &impl BaseState<'tcx>, ) -> Option<&FnTraitImpls<'tcx>>
The virtual Fn* impls for this constructor.
Trait Implementations§
Auto Trait Implementations§
impl<'tcx> !DynSync for Ctor<'tcx>
impl<'tcx> !Freeze for Ctor<'tcx>
impl<'tcx> !RefUnwindSafe for Ctor<'tcx>
impl<'tcx> !Sync for Ctor<'tcx>
impl<'tcx> !UnwindSafe for Ctor<'tcx>
impl<'tcx> DynSend for Ctor<'tcx>
impl<'tcx> Send for Ctor<'tcx>
impl<'tcx> Unpin for Ctor<'tcx>
impl<'tcx> UnsafeUnpin for Ctor<'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more