Struct rustc_mir::monomorphize::Instance [−][src]
pub struct Instance<'tcx> {
pub def: InstanceDef<'tcx>,
pub substs: &'tcx Slice<Kind<'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?
Fields
def: InstanceDef<'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?
substs: &'tcx Slice<Kind<'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?
Methods
impl<'a, 'tcx> Instance<'tcx>[src]
impl<'a, 'tcx> Instance<'tcx>pub fn ty(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>) -> &'tcx TyS<'tcx>[src]
pub fn ty(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>) -> &'tcx TyS<'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?
impl<'a, 'b, 'tcx> Instance<'tcx>[src]
impl<'a, 'b, 'tcx> Instance<'tcx>pub fn new(def_id: DefId, substs: &'tcx Slice<Kind<'tcx>>) -> Instance<'tcx>[src]
pub fn new(def_id: DefId, substs: &'tcx Slice<Kind<'tcx>>) -> Instance<'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?
pub fn mono(tcx: TyCtxt<'a, 'tcx, 'b>, def_id: DefId) -> Instance<'tcx>[src]
pub fn mono(tcx: TyCtxt<'a, 'tcx, 'b>, def_id: DefId) -> Instance<'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?
pub fn def_id(&self) -> DefId[src]
pub fn def_id(&self) -> DefId🔬 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 resolve(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
param_env: ParamEnv<'tcx>,
def_id: DefId,
substs: &'tcx Slice<Kind<'tcx>>
) -> Option<Instance<'tcx>>[src]
pub fn resolve(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
param_env: ParamEnv<'tcx>,
def_id: DefId,
substs: &'tcx Slice<Kind<'tcx>>
) -> Option<Instance<'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?
Resolve a (def_id, substs) pair to an (optional) instance -- most commonly, this is used to find the precise code that will run for a trait method invocation, if known.
Returns None if we cannot resolve Instance to a specific instance.
For example, in a context like this,
fn foo<T: Debug>(t: T) { ... }
trying to resolve Debug::fmt applied to T will yield None, because we do not
know what code ought to run. (Note that this setting is also affected by the
RevealMode in the parameter environment.)
Presuming that coherence and type-check have succeeded, if this method is invoked
in a monomorphic context (i.e., like during codegen), then it is guaranteed to return
Some.
pub fn resolve_closure(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId,
substs: ClosureSubsts<'tcx>,
requested_kind: ClosureKind
) -> Instance<'tcx>[src]
pub fn resolve_closure(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId,
substs: ClosureSubsts<'tcx>,
requested_kind: ClosureKind
) -> Instance<'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?
Trait Implementations
impl<'tcx> Clone for Instance<'tcx>[src]
impl<'tcx> Clone for Instance<'tcx>fn clone(&self) -> Instance<'tcx>[src]
fn clone(&self) -> Instance<'tcx>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<'tcx> Copy for Instance<'tcx>[src]
impl<'tcx> Copy for Instance<'tcx>impl<'tcx> Encodable for Instance<'tcx>[src]
impl<'tcx> Encodable for Instance<'tcx>fn encode<__S>(&self, s: &mut __S) -> Result<(), <__S as Encoder>::Error> where
__S: Encoder, [src]
fn encode<__S>(&self, s: &mut __S) -> Result<(), <__S as Encoder>::Error> where
__S: Encoder, 🔬 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> TypeFoldable<'tcx> for Instance<'tcx>[src]
impl<'tcx> TypeFoldable<'tcx> for Instance<'tcx>fn super_fold_with<'gcx, F>(&self, folder: &mut F) -> Instance<'tcx> where
'gcx: 'tcx,
F: TypeFolder<'gcx, 'tcx>, [src]
fn super_fold_with<'gcx, F>(&self, folder: &mut F) -> Instance<'tcx> where
'gcx: 'tcx,
F: TypeFolder<'gcx, '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 super_visit_with<V>(&self, visitor: &mut V) -> bool where
V: TypeVisitor<'tcx>, [src]
fn super_visit_with<V>(&self, visitor: &mut V) -> bool where
V: TypeVisitor<'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 fold_with<'gcx, F>(&self, folder: &mut F) -> Self where
'gcx: 'tcx,
F: TypeFolder<'gcx, 'tcx>, [src]
fn fold_with<'gcx, F>(&self, folder: &mut F) -> Self where
'gcx: 'tcx,
F: TypeFolder<'gcx, '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 visit_with<V>(&self, visitor: &mut V) -> bool where
V: TypeVisitor<'tcx>, [src]
fn visit_with<V>(&self, visitor: &mut V) -> bool where
V: TypeVisitor<'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 has_regions_bound_at_or_above(&self, binder: DebruijnIndex) -> bool[src]
fn has_regions_bound_at_or_above(&self, binder: DebruijnIndex) -> bool🔬 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?
True if self has any late-bound regions that are either bound by binder or bound by some binder outside of binder. If binder is ty::INNERMOST, this indicates whether there are any late-bound regions that appear free. Read more
fn has_regions_bound_above(&self, binder: DebruijnIndex) -> bool[src]
fn has_regions_bound_above(&self, binder: DebruijnIndex) -> bool🔬 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?
True if this self has any regions that escape binder (and hence are not bound by it). Read more
fn has_escaping_regions(&self) -> bool[src]
fn has_escaping_regions(&self) -> bool🔬 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]
fn has_type_flags(&self, flags: TypeFlags) -> bool🔬 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]
fn has_projections(&self) -> bool🔬 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]
fn references_error(&self) -> bool🔬 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]
fn has_param_types(&self) -> bool🔬 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]
fn has_self_ty(&self) -> bool🔬 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]
fn has_infer_types(&self) -> bool🔬 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]
fn needs_infer(&self) -> bool🔬 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_skol(&self) -> bool[src]
fn has_skol(&self) -> bool🔬 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]
fn needs_subst(&self) -> bool🔬 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]
fn has_re_skol(&self) -> bool🔬 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]
fn has_closure_types(&self) -> bool🔬 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_free_regions(&self) -> bool[src]
fn has_free_regions(&self) -> bool🔬 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?
"Free" regions in this context means that it has any region that is not (a) erased or (b) late-bound. Read more
fn has_erasable_regions(&self) -> bool[src]
fn has_erasable_regions(&self) -> bool🔬 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?
True if there any any un-erased free regions.
fn is_global(&self) -> bool[src]
fn is_global(&self) -> bool🔬 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. Read more
fn has_late_bound_regions(&self) -> bool[src]
fn has_late_bound_regions(&self) -> bool🔬 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?
True if there are any late-bound regions
fn visit_tys_shallow<impl FnMut(Ty<'tcx>) -> bool>(
&self,
visit: impl FnMut(Ty<'tcx>) -> bool
) -> bool where
impl FnMut(Ty<'tcx>) -> bool: FnMut(&'tcx TyS<'tcx>) -> bool, [src]
fn visit_tys_shallow<impl FnMut(Ty<'tcx>) -> bool>(
&self,
visit: impl FnMut(Ty<'tcx>) -> bool
) -> bool where
impl FnMut(Ty<'tcx>) -> bool: FnMut(&'tcx TyS<'tcx>) -> bool, 🔬 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?
A visitor that does not recurse into types, works like fn walk_shallow in Ty.
impl<'a, 'tcx> Lift<'tcx> for Instance<'a>[src]
impl<'a, 'tcx> Lift<'tcx> for Instance<'a>type Lifted = Instance<'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(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<Instance<'tcx>>[src]
fn lift_to_tcx(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<Instance<'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?
impl<'tcx> Display for Instance<'tcx>[src]
impl<'tcx> Display for Instance<'tcx>fn fmt(&self, f: &mut Formatter) -> Result<(), Error>[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl<'tcx> Debug for Instance<'tcx>[src]
impl<'tcx> Debug for Instance<'tcx>fn fmt(&self, f: &mut Formatter) -> Result<(), Error>[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl<'tcx> Eq for Instance<'tcx>[src]
impl<'tcx> Eq for Instance<'tcx>fn assert_receiver_is_total_eq(&self)[src]
fn assert_receiver_is_total_eq(&self)impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for Instance<'tcx>[src]
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for Instance<'tcx>fn hash_stable<W>(
&self,
__ctx: &mut StableHashingContext<'a>,
__hasher: &mut StableHasher<W>
) where
W: StableHasherResult, [src]
fn hash_stable<W>(
&self,
__ctx: &mut StableHashingContext<'a>,
__hasher: &mut StableHasher<W>
) where
W: StableHasherResult, 🔬 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> Hash for Instance<'tcx>[src]
impl<'tcx> Hash for Instance<'tcx>fn hash<__H>(&self, state: &mut __H) where
__H: Hasher, [src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher, Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl<'tcx> Decodable for Instance<'tcx>[src]
impl<'tcx> Decodable for Instance<'tcx>fn decode<__D>(d: &mut __D) -> Result<Instance<'tcx>, <__D as Decoder>::Error> where
__D: Decoder, [src]
fn decode<__D>(d: &mut __D) -> Result<Instance<'tcx>, <__D as Decoder>::Error> where
__D: Decoder, 🔬 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> PartialEq<Instance<'tcx>> for Instance<'tcx>[src]
impl<'tcx> PartialEq<Instance<'tcx>> for Instance<'tcx>