Struct rustc::ty::Generics [−][src]
pub struct Generics { pub parent: Option<DefId>, pub parent_count: usize, pub params: Vec<GenericParamDef>, pub param_def_id_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.
The ordering of parameters is the same as in Subst (excluding child generics): Self (optionally), Lifetime params..., 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_count: 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?
params: Vec<GenericParamDef>
🔬 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?
param_def_id_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 the index
field of each GenericParamDef
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 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 own_counts(&self) -> GenericParamCount
[src]
pub fn own_counts(&self) -> GenericParamCount
🔬 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 requires_monomorphization(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> bool
[src]
pub fn requires_monomorphization(&self, tcx: TyCtxt<'a, 'gcx, '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?
pub fn region_param(
&'tcx self,
param: &EarlyBoundRegion,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> &'tcx GenericParamDef
[src]
pub fn region_param(
&'tcx self,
param: &EarlyBoundRegion,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> &'tcx GenericParamDef
🔬 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>
) -> &'tcx GenericParamDef
[src]
pub fn type_param(
&'tcx self,
param: &ParamTy,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> &'tcx GenericParamDef
🔬 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 GenericParamDef
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, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &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, s: &mut __S) -> Result<(), __S::Error>
[src]
fn encode<__S: Encoder>(&self, s: &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