Enum rustc::traits::Vtable
[−]
[src]
pub enum Vtable<'tcx, N> { VtableImpl(VtableImplData<'tcx, N>), VtableAutoImpl(VtableAutoImplData<N>), VtableParam(Vec<N>), VtableObject(VtableObjectData<'tcx, N>), VtableBuiltin(VtableBuiltinData<N>), VtableClosure(VtableClosureData<'tcx, N>), VtableFnPointer(VtableFnPointerData<'tcx, N>), VtableGenerator(VtableGeneratorData<'tcx, N>), }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Given the successful resolution of an obligation, the Vtable
indicates where the vtable comes from. Note that while we call this
a "vtable", it does not necessarily indicate dynamic dispatch at
runtime. Vtable
instances just tell the compiler where to find
methods, but in generic code those methods are typically statically
dispatched -- only when an object is constructed is a Vtable
instance reified into an actual vtable.
For example, the vtable may be tied to a specific impl (case A), or it may be relative to some bound that is in scope (case B).
impl<T:Clone> Clone<T> for Option<T> { ... } // Impl_1 impl<T:Clone> Clone<T> for Box<T> { ... } // Impl_2 impl Clone for int { ... } // Impl_3 fn foo<T:Clone>(concrete: Option<Box<int>>, param: T, mixed: Option<T>) { // Case A: Vtable points at a specific impl. Only possible when // type is concretely known. If the impl itself has bounded // type parameters, Vtable will carry resolutions for those as well: concrete.clone(); // Vtable(Impl_1, [Vtable(Impl_2, [Vtable(Impl_3)])]) // Case B: Vtable must be provided by caller. This applies when // type is a type parameter. param.clone(); // VtableParam // Case C: A mix of cases A and B. mixed.clone(); // Vtable(Impl_1, [VtableParam]) }
The type parameter N
See explanation on VtableImplData
.
Variants
VtableImpl(VtableImplData<'tcx, N>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Vtable identifying a particular impl.
VtableAutoImpl(VtableAutoImplData<N>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Vtable for auto trait implementations
This carries the information and nested obligations with regards
to an auto implementation for a trait Trait
. The nested obligations
ensure the trait implementation holds for all the constituent types.
VtableParam(Vec<N>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Successful resolution to an obligation provided by the caller
for some type parameter. The Vec<N>
represents the
obligations incurred from normalizing the where-clause (if
any).
VtableObject(VtableObjectData<'tcx, N>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Virtual calls through an object
VtableBuiltin(VtableBuiltinData<N>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Successful resolution for a builtin trait.
VtableClosure(VtableClosureData<'tcx, N>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Vtable automatically generated for a closure. The def ID is the ID
of the closure expression. This is a VtableImpl
in spirit, but the
impl is generated by the compiler and does not appear in the source.
VtableFnPointer(VtableFnPointerData<'tcx, N>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Same as above, but for a fn pointer type with the given signature.
VtableGenerator(VtableGeneratorData<'tcx, N>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Vtable automatically generated for a generator
Methods
impl<'tcx, N> Vtable<'tcx, N>
[src]
pub fn nested_obligations(self) -> Vec<N>
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn map<M, F>(self, f: F) -> Vtable<'tcx, M> where
F: FnMut(N) -> M,
[src]
F: FnMut(N) -> M,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Trait Implementations
impl<'gcx, N> HashStable<StableHashingContext<'gcx>> for Vtable<'gcx, N> where
N: HashStable<StableHashingContext<'gcx>>,
[src]
N: HashStable<StableHashingContext<'gcx>>,
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'gcx>,
hasher: &mut StableHasher<W>
)
[src]
&self,
hcx: &mut StableHashingContext<'gcx>,
hasher: &mut StableHasher<W>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx, N: Debug> Debug for Vtable<'tcx, N>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a, 'tcx> Lift<'tcx> for Vtable<'a, ()>
[src]
type Lifted = Vtable<'tcx, ()>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'b, 'gcx>(
&self,
tcx: TyCtxt<'b, 'gcx, 'tcx>
) -> Option<Self::Lifted>
[src]
&self,
tcx: TyCtxt<'b, 'gcx, 'tcx>
) -> Option<Self::Lifted>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx, N: TypeFoldable<'tcx>> TypeFoldable<'tcx> for Vtable<'tcx, N>
[src]
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(
&self,
folder: &mut F
) -> Self
[src]
&self,
folder: &mut F
) -> Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(
&self,
folder: &mut F
) -> Self
[src]
&self,
folder: &mut F
) -> Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn has_regions_escaping_depth(&self, depth: u32) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn has_escaping_regions(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn has_type_flags(&self, flags: TypeFlags) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn has_projections(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn references_error(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn has_param_types(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn has_self_ty(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn has_infer_types(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn needs_infer(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn needs_subst(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn has_re_skol(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn has_closure_types(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn has_erasable_regions(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn is_normalized_for_trans(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn is_global(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Indicates whether this value references only 'global' types/lifetimes that are the same regardless of what fn we are in. This is used for caching. Errs on the side of returning false. Read more
impl<'tcx, N: Clone> Clone for Vtable<'tcx, N>
[src]
fn clone(&self) -> Vtable<'tcx, N>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'tcx, N: Encodable> Encodable for Vtable<'tcx, N>
[src]
fn encode<__SN: Encoder>(&self, __arg_0: &mut __SN) -> Result<(), __SN::Error>
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?