Type Alias rustc_middle::query::queries::generics_of::ProvidedValue
source · pub type ProvidedValue<'tcx> = Generics;Expand description
This type alias specifies the type returned from query providers and the type
used for decoding. For regular queries this is the declared returned type V,
but arena_cache will use <V as Deref>::Target instead.
Implementations§
source§impl<'tcx> Generics
impl<'tcx> Generics
sourcepub fn param_def_id_to_index(
&self,
tcx: TyCtxt<'tcx>,
def_id: DefId
) -> Option<u32>
pub fn param_def_id_to_index( &self, tcx: TyCtxt<'tcx>, def_id: DefId ) -> Option<u32>
Looks through the generics and all parents to find the index of the
given param def-id. This is in comparison to the param_def_id_to_index
struct member, which only stores information about this item’s own
generics.
pub fn count(&self) -> usize
pub fn own_counts(&self) -> GenericParamCount
pub fn own_defaults(&self) -> GenericParamCount
pub fn requires_monomorphization(&self, tcx: TyCtxt<'tcx>) -> bool
pub fn own_requires_monomorphization(&self) -> bool
sourcepub fn param_at(
&'tcx self,
param_index: usize,
tcx: TyCtxt<'tcx>
) -> &'tcx GenericParamDef
pub fn param_at( &'tcx self, param_index: usize, tcx: TyCtxt<'tcx> ) -> &'tcx GenericParamDef
Returns the GenericParamDef with the given index.
pub fn params_to( &'tcx self, param_index: usize, tcx: TyCtxt<'tcx> ) -> &'tcx [GenericParamDef]
sourcepub fn region_param(
&'tcx self,
param: &EarlyBoundRegion,
tcx: TyCtxt<'tcx>
) -> &'tcx GenericParamDef
pub fn region_param( &'tcx self, param: &EarlyBoundRegion, tcx: TyCtxt<'tcx> ) -> &'tcx GenericParamDef
Returns the GenericParamDef associated with this EarlyBoundRegion.
sourcepub fn type_param(
&'tcx self,
param: &ParamTy,
tcx: TyCtxt<'tcx>
) -> &'tcx GenericParamDef
pub fn type_param( &'tcx self, param: &ParamTy, tcx: TyCtxt<'tcx> ) -> &'tcx GenericParamDef
Returns the GenericParamDef associated with this ParamTy.
sourcepub fn const_param(
&'tcx self,
param: &ParamConst,
tcx: TyCtxt<'tcx>
) -> &GenericParamDef
pub fn const_param( &'tcx self, param: &ParamConst, tcx: TyCtxt<'tcx> ) -> &GenericParamDef
Returns the GenericParamDef associated with this ParamConst.
sourcepub fn has_impl_trait(&'tcx self) -> bool
pub fn has_impl_trait(&'tcx self) -> bool
Returns true if params has impl Trait.
sourcepub fn own_args_no_defaults(
&'tcx self,
tcx: TyCtxt<'tcx>,
args: &'tcx [GenericArg<'tcx>]
) -> &'tcx [GenericArg<'tcx>]
pub fn own_args_no_defaults( &'tcx self, tcx: TyCtxt<'tcx>, args: &'tcx [GenericArg<'tcx>] ) -> &'tcx [GenericArg<'tcx>]
Returns the args corresponding to the generic parameters
of this item, excluding Self.
This should only be used for diagnostics purposes.
sourcepub fn own_args(
&'tcx self,
args: &'tcx [GenericArg<'tcx>]
) -> &'tcx [GenericArg<'tcx>]
pub fn own_args( &'tcx self, args: &'tcx [GenericArg<'tcx>] ) -> &'tcx [GenericArg<'tcx>]
Returns the args corresponding to the generic parameters of this item, excluding Self.
This should only be used for diagnostics purposes.
Trait Implementations§
source§impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for Generics
impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for Generics
fn hash_stable( &self, __hcx: &mut StableHashingContext<'__ctx>, __hasher: &mut StableHasher )
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size:104 bytes