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

source

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.

source

pub fn count(&self) -> usize

source

pub fn own_counts(&self) -> GenericParamCount

source

pub fn own_defaults(&self) -> GenericParamCount

source

pub fn requires_monomorphization(&self, tcx: TyCtxt<'tcx>) -> bool

source

pub fn own_requires_monomorphization(&self) -> bool

source

pub fn param_at( &'tcx self, param_index: usize, tcx: TyCtxt<'tcx> ) -> &'tcx GenericParamDef

Returns the GenericParamDef with the given index.

source

pub fn params_to( &'tcx self, param_index: usize, tcx: TyCtxt<'tcx> ) -> &'tcx [GenericParamDef]

source

pub fn region_param( &'tcx self, param: &EarlyBoundRegion, tcx: TyCtxt<'tcx> ) -> &'tcx GenericParamDef

Returns the GenericParamDef associated with this EarlyBoundRegion.

source

pub fn type_param( &'tcx self, param: &ParamTy, tcx: TyCtxt<'tcx> ) -> &'tcx GenericParamDef

Returns the GenericParamDef associated with this ParamTy.

source

pub fn const_param( &'tcx self, param: &ParamConst, tcx: TyCtxt<'tcx> ) -> &GenericParamDef

Returns the GenericParamDef associated with this ParamConst.

source

pub fn has_impl_trait(&'tcx self) -> bool

Returns true if params has impl Trait.

source

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.

source

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 Clone for Generics

source§

fn clone(&self) -> Generics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Generics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'tcx, __D: TyDecoder<I = TyCtxt<'tcx>>> Decodable<__D> for Generics

source§

fn decode(__decoder: &mut __D) -> Self

source§

impl<'tcx, __E: TyEncoder<I = TyCtxt<'tcx>>> Encodable<__E> for Generics

source§

fn encode(&self, __encoder: &mut __E)

source§

impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for Generics

source§

fn hash_stable( &self, __hcx: &mut StableHashingContext<'__ctx>, __hasher: &mut StableHasher )

source§

impl ParameterizedOverTcx for Generics

§

type Value<'tcx> = Generics

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