[][src]Enum rustc::ty::InstanceDef

pub enum InstanceDef<'tcx> {
    Item(DefId),
    Intrinsic(DefId),
    VtableShim(DefId),
    ReifyShim(DefId),
    FnPtrShim(DefIdTy<'tcx>),
    Virtual(DefIdusize),
    ClosureOnceShim {
        call_once: DefId,
    },
    DropGlue(DefIdOption<Ty<'tcx>>),
    CloneShim(DefIdTy<'tcx>),
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Variants

Item(DefId)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Intrinsic(DefId)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

VtableShim(DefId)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

<T as Trait>::method where method receives unsizeable self: Self.

ReifyShim(DefId)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn() pointer where the function itself cannot be turned into a pointer.

One example is <dyn Trait as Trait>::fn, where the shim contains a virtual call, which codegen supports only via a direct call to the <dyn Trait as Trait>::fn instance (an InstanceDef::Virtual).

Another example is functions annotated with #[track_caller], which must have their implicit caller location argument populated for a call. Because this is a required part of the function's ABI but can't be tracked as a property of the function pointer, we use a single "caller location" (the definition of the function itself).

FnPtrShim(DefIdTy<'tcx>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

<fn() as FnTrait>::call_* DefId is FnTrait::call_*.

Virtual(DefIdusize)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

<dyn Trait as Trait>::fn, "direct calls" of which are implicitly codegen'd as virtual calls.

NB: if this is reified to a fn pointer, a ReifyShim is used (see ReifyShim above for more details on that).

ClosureOnceShim
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

<[mut closure] as FnOnce>::call_once

Fields of ClosureOnceShim

call_once: DefId
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

DropGlue(DefIdOption<Ty<'tcx>>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

drop_in_place::<T>; None for empty drop glue.

CloneShim(DefIdTy<'tcx>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

<T as Clone>::clone shim.

Methods

impl<'tcx> InstanceDef<'tcx>[src]

pub fn def_id(&self) -> DefId[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn attrs(&self, tcx: TyCtxt<'tcx>) -> Attributes<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn is_inline(&self, tcx: TyCtxt<'tcx>) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn requires_local(&self, tcx: TyCtxt<'tcx>) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn requires_caller_location(&self, tcx: TyCtxt) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Trait Implementations

impl<'tcx> Clone for InstanceDef<'tcx>[src]

impl<'tcx> Copy for InstanceDef<'tcx>[src]

impl<'tcx> Debug for InstanceDef<'tcx>[src]

impl<'tcx> Decodable for InstanceDef<'tcx>[src]

impl<'tcx> Encodable for InstanceDef<'tcx>[src]

impl<'tcx> Eq for InstanceDef<'tcx>[src]

impl<'tcx> Hash for InstanceDef<'tcx>[src]

impl<'tcx, '__ctx> HashStable<StableHashingContext<'__ctx>> for InstanceDef<'tcx>[src]

impl<'tcx> Key for InstanceDef<'tcx>[src]

impl<'a, 'tcx> Lift<'tcx> for InstanceDef<'a>[src]

type Lifted = InstanceDef<'tcx>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'tcx> PartialEq<InstanceDef<'tcx>> for InstanceDef<'tcx>[src]

impl<'tcx> StructuralEq for InstanceDef<'tcx>[src]

impl<'tcx> StructuralPartialEq for InstanceDef<'tcx>[src]

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for InstanceDef<'tcx>

impl<'tcx> !Send for InstanceDef<'tcx>

impl<'tcx> !Sync for InstanceDef<'tcx>

impl<'tcx> Unpin for InstanceDef<'tcx>

impl<'tcx> !UnwindSafe for InstanceDef<'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ArenaAllocatable for T where
    T: Copy
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> Decodable for T where
    T: UseSpecializedDecodable
[src]

impl<T> Encodable for T where
    T: UseSpecializedEncodable + ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeResult<T> for T[src]

type Error = !

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<E> SpecializationError for E[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.