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]
impl<'a, 'gcx, 'tcx> Substs<'tcx>
pub fn identity_for_item(
tcx: TyCtxt<'a, 'gcx, 'tcx>,
def_id: DefId
) -> &'tcx Substs<'tcx>
[src]
pub fn identity_for_item(
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]
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>,
🔬 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]
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>,
🔬 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]
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>,
🔬 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 fill_single<FR, FT>(
substs: &mut Vec<Kind<'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]
fn fill_single<FR, FT>(
substs: &mut Vec<Kind<'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]
pub fn is_noop(&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?
pub fn types(
&'a self
) -> impl DoubleEndedIterator<Item = Ty<'tcx>> + 'a
[src]
pub fn types(
&'a self
) -> impl DoubleEndedIterator<Item = Ty<'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?
pub fn regions(
&'a self
) -> impl DoubleEndedIterator<Item = Region<'tcx>> + 'a
[src]
pub fn regions(
&'a self
) -> impl DoubleEndedIterator<Item = Region<'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?
pub fn type_at(&self, i: usize) -> Ty<'tcx>
[src]
pub fn type_at(&self, i: usize) -> 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 region_at(&self, i: usize) -> Region<'tcx>
[src]
pub fn region_at(&self, i: usize) -> Region<'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 type_for_def(&self, ty_param_def: &TypeParameterDef) -> Ty<'tcx>
[src]
pub fn type_for_def(&self, ty_param_def: &TypeParameterDef) -> 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 region_for_def(&self, def: &RegionParameterDef) -> Region<'tcx>
[src]
pub fn region_for_def(&self, def: &RegionParameterDef) -> Region<'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 rebase_onto(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
source_ancestor: DefId,
target_substs: &Substs<'tcx>
) -> &'tcx Substs<'tcx>
[src]
pub fn rebase_onto(
&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]
pub fn truncate_to(
&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<'a, 'tcx, 'x> SpecializedDecoder<&'tcx Substs<'tcx>> for CacheDecoder<'a, 'tcx, 'x>
[src]
impl<'a, 'tcx, 'x> SpecializedDecoder<&'tcx Substs<'tcx>> for CacheDecoder<'a, 'tcx, 'x>
fn specialized_decode(&mut self) -> Result<&'tcx Substs<'tcx>, Self::Error>
[src]
fn specialized_decode(&mut self) -> Result<&'tcx Substs<'tcx>, Self::Error>
🔬 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?
Decode a value in a manner specific to this decoder state.
impl<'tcx> Relate<'tcx> for &'tcx Substs<'tcx>
[src]
impl<'tcx> Relate<'tcx> for &'tcx Substs<'tcx>
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]
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,
🔬 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]
impl<'tcx> TypeFoldable<'tcx> for &'tcx Substs<'tcx>
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(
&self,
folder: &mut F
) -> Self
[src]
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(
&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]
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> 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 fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(
&self,
folder: &mut F
) -> Self
[src]
fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(
&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]
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> 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_regions_escaping_depth(&self, depth: u32) -> bool
[src]
fn has_regions_escaping_depth(&self, depth: u32) -> 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_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. Errs on the side of returning false. Read more
impl<'tcx> UseSpecializedDecodable for &'tcx Substs<'tcx>
[src]
impl<'tcx> UseSpecializedDecodable for &'tcx Substs<'tcx>
fn default_decode<D>(&mut D) -> Result<Self, <D as Decoder>::Error> where
D: Decoder,
[src]
fn default_decode<D>(&mut D) -> Result<Self, <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?
Defaults to returning an error (see SpecializationError
).
impl<'a, 'tcx> Lift<'tcx> for &'a Substs<'a>
[src]
impl<'a, 'tcx> Lift<'tcx> for &'a Substs<'a>
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]
fn lift_to_tcx<'b, 'gcx>(
&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?