Struct rustc::ty::Generics
[−]
[src]
pub struct Generics { pub parent: Option<DefId>, pub parent_regions: u32, pub parent_types: u32, pub regions: Vec<RegionParameterDef>, pub types: Vec<TypeParameterDef>, pub type_param_to_index: FxHashMap<DefId, u32>, pub has_self: bool, pub has_late_bound_regions: Option<Span>, }
🔬 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?
Information about the formal type/lifetime parameters associated with an item or method. Analogous to hir::Generics.
Note that in the presence of a Self
parameter, the ordering here
is different from the ordering in a Substs. Substs are ordered as
Self, *Regions, *Other Type Params, (...child generics)
while this struct is ordered as
regions = Regions
types = [Self, *Other Type Params]
Fields
parent: Option<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?
parent_regions: u32
🔬 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?
parent_types: u32
🔬 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?
regions: Vec<RegionParameterDef>
🔬 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?
types: Vec<TypeParameterDef>
🔬 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?
type_param_to_index: FxHashMap<DefId, u32>
🔬 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?
Reverse map to each TypeParameterDef
's index
field
has_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?
has_late_bound_regions: Option<Span>
🔬 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, 'gcx, 'tcx> Generics
[src]
impl<'a, 'gcx, 'tcx> Generics
pub fn parent_count(&self) -> usize
[src]
pub fn parent_count(&self) -> usize
🔬 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 own_count(&self) -> usize
[src]
pub fn own_count(&self) -> usize
🔬 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 count(&self) -> usize
[src]
pub fn count(&self) -> usize
🔬 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_param(
&'tcx self,
param: &EarlyBoundRegion,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> &'tcx RegionParameterDef
[src]
pub fn region_param(
&'tcx self,
param: &EarlyBoundRegion,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> &'tcx RegionParameterDef
🔬 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_param(
&'tcx self,
param: &ParamTy,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> &TypeParameterDef
[src]
pub fn type_param(
&'tcx self,
param: &ParamTy,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> &TypeParameterDef
🔬 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?
Returns the TypeParameterDef
associated with this ParamTy
.
Trait Implementations
impl<'a> HashStable<StableHashingContext<'a>> for Generics
[src]
impl<'a> HashStable<StableHashingContext<'a>> for Generics
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>
)
[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
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 Clone for Generics
[src]
impl Clone for Generics
fn clone(&self) -> Generics
[src]
fn clone(&self) -> Generics
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 Debug for Generics
[src]
impl Debug for Generics
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Encodable for Generics
[src]
impl Encodable for Generics
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::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?
impl Decodable for Generics
[src]
impl Decodable for Generics