Type Definition rustc::ty::subst::Substs
[−]
[src]
type 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?
A substitution mapping type/region parameters to new values.
Methods
impl<'a, 'gcx, 'tcx> Substs<'tcx>
[src]
pub fn identity_for_item(
tcx: TyCtxt<'a, 'gcx, 'tcx>,
def_id: DefId
) -> &'tcx Substs<'tcx>
[src]
tcx: TyCtxt<'a, 'gcx, 'tcx>,
def_id: DefId
) -> &'tcx Substs<'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?
Creates a Substs that maps each generic parameter to itself.
pub fn for_item<FR, FT>(
tcx: TyCtxt<'a, 'gcx, 'tcx>,
def_id: DefId,
mk_region: FR,
mk_type: FT
) -> &'tcx Substs<'tcx> where
FR: FnMut(&RegionParameterDef, &[Kind<'tcx>]) -> Region<'tcx>,
FT: FnMut(&TypeParameterDef, &[Kind<'tcx>]) -> Ty<'tcx>,
[src]
tcx: TyCtxt<'a, 'gcx, 'tcx>,
def_id: DefId,
mk_region: FR,
mk_type: FT
) -> &'tcx Substs<'tcx> where
FR: FnMut(&RegionParameterDef, &[Kind<'tcx>]) -> Region<'tcx>,
FT: FnMut(&TypeParameterDef, &[Kind<'tcx>]) -> Ty<'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?
Creates a Substs for generic parameter definitions, by calling closures to obtain each region and type. The closures get to observe the Substs as they're being built, which can be used to correctly substitute defaults of type parameters.
pub fn extend_to<FR, FT>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
def_id: DefId,
mk_region: FR,
mk_type: FT
) -> &'tcx Substs<'tcx> where
FR: FnMut(&RegionParameterDef, &[Kind<'tcx>]) -> Region<'tcx>,
FT: FnMut(&TypeParameterDef, &[Kind<'tcx>]) -> Ty<'tcx>,
[src]
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
def_id: DefId,
mk_region: FR,
mk_type: FT
) -> &'tcx Substs<'tcx> where
FR: FnMut(&RegionParameterDef, &[Kind<'tcx>]) -> Region<'tcx>,
FT: FnMut(&TypeParameterDef, &[Kind<'tcx>]) -> Ty<'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 fill_item<FR, FT>(
substs: &mut Vec<Kind<'tcx>>,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
defs: &Generics,
mk_region: &mut FR,
mk_type: &mut FT
) where
FR: FnMut(&RegionParameterDef, &[Kind<'tcx>]) -> Region<'tcx>,
FT: FnMut(&TypeParameterDef, &[Kind<'tcx>]) -> Ty<'tcx>,
[src]
substs: &mut Vec<Kind<'tcx>>,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
defs: &Generics,
mk_region: &mut FR,
mk_type: &mut FT
) where
FR: FnMut(&RegionParameterDef, &[Kind<'tcx>]) -> Region<'tcx>,
FT: FnMut(&TypeParameterDef, &[Kind<'tcx>]) -> Ty<'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 is_noop(&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?
pub fn types(&'a self) -> impl DoubleEndedIterator<Item = Ty<'tcx>> + 'a
[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 regions(&'a self) -> impl DoubleEndedIterator<Item = Region<'tcx>> + 'a
[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 type_at(&self, i: usize) -> Ty<'tcx>
[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 region_at(&self, i: usize) -> Region<'tcx>
[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 type_for_def(&self, ty_param_def: &TypeParameterDef) -> Ty<'tcx>
[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 region_for_def(&self, def: &RegionParameterDef) -> Region<'tcx>
[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 rebase_onto(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
source_ancestor: DefId,
target_substs: &Substs<'tcx>
) -> &'tcx Substs<'tcx>
[src]
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
source_ancestor: DefId,
target_substs: &Substs<'tcx>
) -> &'tcx Substs<'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?
Transform from substitutions for a child of source_ancestor
(e.g. a trait or impl) to substitutions for the same child
in a different item, with target_substs
as the base for
the target impl/trait, with the source child-specific
parameters (e.g. method parameters) on top of that base.
pub fn truncate_to(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
generics: &Generics
) -> &'tcx Substs<'tcx>
[src]
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
generics: &Generics
) -> &'tcx Substs<'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<'gcx> TransNormalize<'gcx> for &'gcx Substs<'gcx>
[src]
fn trans_normalize<'a, 'tcx>(
&self,
infcx: &InferCtxt<'a, 'gcx, 'tcx>,
param_env: ParamEnv<'tcx>
) -> Self
[src]
&self,
infcx: &InferCtxt<'a, 'gcx, 'tcx>,
param_env: ParamEnv<'tcx>
) -> 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?
impl<'tcx> Relate<'tcx> for &'tcx Substs<'tcx>
[src]
fn relate<'a, 'gcx, R>(
relation: &mut R,
a: &&'tcx Substs<'tcx>,
b: &&'tcx Substs<'tcx>
) -> RelateResult<'tcx, &'tcx Substs<'tcx>> where
R: TypeRelation<'a, 'gcx, 'tcx>,
'gcx: 'a + 'tcx,
'tcx: 'a,
[src]
relation: &mut R,
a: &&'tcx Substs<'tcx>,
b: &&'tcx Substs<'tcx>
) -> RelateResult<'tcx, &'tcx Substs<'tcx>> where
R: TypeRelation<'a, 'gcx, 'tcx>,
'gcx: 'a + 'tcx,
'tcx: 'a,
🔬 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 &'tcx Substs<'tcx>
[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> UseSpecializedDecodable for &'tcx Substs<'tcx>
[src]
fn default_decode<D>(&mut D) -> Result<Self, <D as Decoder>::Error> where
D: Decoder,
[src]
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?
Defaults to returning an error (see SpecializationError
).
impl<'a, 'tcx> Lift<'tcx> for &'a Substs<'a>
[src]
type Lifted = &'tcx Substs<'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<&'tcx Substs<'tcx>>
[src]
&self,
tcx: TyCtxt<'b, 'gcx, 'tcx>
) -> Option<&'tcx Substs<'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?