enum SelfTyHead {
Generic,
Primitive,
Item(DefId),
Other,
}Variants§
Implementations§
Source§impl SelfTyHead
impl SelfTyHead
Sourcefn of<'tcx>(
bound_ty: Binder<'tcx, Ty<'tcx>>,
tcx: TyCtxt<'tcx>,
parent: DefId,
) -> Self
fn of<'tcx>( bound_ty: Binder<'tcx, Ty<'tcx>>, tcx: TyCtxt<'tcx>, parent: DefId, ) -> Self
Compute the “head” (top-level structure) of a type.
When deciding whether to inline an impl, one of the things we look at is
whether the Self type (the Foo in impl Foo or impl Tr for Foo) is
present in the current crate (usually itself through inlining). However,
constructing a full clean::Type is expensive and more than we need,
so this function computes just enough information to determine if the type
is in the current crate.
Trait Implementations§
Auto Trait Implementations§
impl DynSend for SelfTyHead
impl DynSync for SelfTyHead
impl Freeze for SelfTyHead
impl RefUnwindSafe for SelfTyHead
impl Send for SelfTyHead
impl Sync for SelfTyHead
impl Unpin for SelfTyHead
impl UnsafeUnpin for SelfTyHead
impl UnwindSafe for SelfTyHead
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
§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§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes
Size for each variant:
Generic: 0 bytesPrimitive: 0 bytesItem: 8 bytesOther: 0 bytes