Struct rustc_traits::chalk::db::RustIrDatabase
source · pub struct RustIrDatabase<'tcx> {
pub(crate) interner: RustInterner<'tcx>,
}
Fields§
§interner: RustInterner<'tcx>
Implementations§
source§impl<'tcx> RustIrDatabase<'tcx>
impl<'tcx> RustIrDatabase<'tcx>
fn where_clauses_for(
&self,
def_id: DefId,
bound_vars: SubstsRef<'tcx>
) -> Vec<QuantifiedWhereClause<RustInterner<'tcx>>>
fn bounds_for<T>(&self, def_id: DefId, bound_vars: SubstsRef<'tcx>) -> Vec<T>where
Predicate<'tcx>: LowerInto<'tcx, Option<T>>,
Trait Implementations§
source§impl Debug for RustIrDatabase<'_>
impl Debug for RustIrDatabase<'_>
source§impl<'tcx> RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'tcx>
impl<'tcx> RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'tcx>
fn interner(&self) -> RustInterner<'tcx>
source§fn associated_ty_data(
&self,
assoc_type_id: AssocTypeId<RustInterner<'tcx>>
) -> Arc<AssociatedTyDatum<RustInterner<'tcx>>>
fn associated_ty_data(
&self,
assoc_type_id: AssocTypeId<RustInterner<'tcx>>
) -> Arc<AssociatedTyDatum<RustInterner<'tcx>>>
Returns the datum for the associated type with the given id.
source§fn trait_datum(
&self,
trait_id: TraitId<RustInterner<'tcx>>
) -> Arc<TraitDatum<RustInterner<'tcx>>>
fn trait_datum(
&self,
trait_id: TraitId<RustInterner<'tcx>>
) -> Arc<TraitDatum<RustInterner<'tcx>>>
Returns the datum for the definition with the given id.
source§fn adt_datum(
&self,
adt_id: AdtId<RustInterner<'tcx>>
) -> Arc<AdtDatum<RustInterner<'tcx>>>
fn adt_datum(
&self,
adt_id: AdtId<RustInterner<'tcx>>
) -> Arc<AdtDatum<RustInterner<'tcx>>>
Returns the datum for the ADT with the given id.
source§fn adt_repr(
&self,
adt_id: AdtId<RustInterner<'tcx>>
) -> Arc<AdtRepr<RustInterner<'tcx>>>
fn adt_repr(
&self,
adt_id: AdtId<RustInterner<'tcx>>
) -> Arc<AdtRepr<RustInterner<'tcx>>>
Returns the representation for the ADT definition with the given id.
source§fn adt_size_align(&self, adt_id: AdtId<RustInterner<'tcx>>) -> Arc<AdtSizeAlign>
fn adt_size_align(&self, adt_id: AdtId<RustInterner<'tcx>>) -> Arc<AdtSizeAlign>
Returns the siza and alignment of the ADT definition with the given id.
source§fn fn_def_datum(
&self,
fn_def_id: FnDefId<RustInterner<'tcx>>
) -> Arc<FnDefDatum<RustInterner<'tcx>>>
fn fn_def_datum(
&self,
fn_def_id: FnDefId<RustInterner<'tcx>>
) -> Arc<FnDefDatum<RustInterner<'tcx>>>
Returns the datum for the fn definition with the given id.
source§fn impl_datum(
&self,
impl_id: ImplId<RustInterner<'tcx>>
) -> Arc<ImplDatum<RustInterner<'tcx>>>
fn impl_datum(
&self,
impl_id: ImplId<RustInterner<'tcx>>
) -> Arc<ImplDatum<RustInterner<'tcx>>>
Returns the datum for the impl with the given id.
source§fn impls_for_trait(
&self,
trait_id: TraitId<RustInterner<'tcx>>,
parameters: &[GenericArg<RustInterner<'tcx>>],
_binders: &CanonicalVarKinds<RustInterner<'tcx>>
) -> Vec<ImplId<RustInterner<'tcx>>>
fn impls_for_trait(
&self,
trait_id: TraitId<RustInterner<'tcx>>,
parameters: &[GenericArg<RustInterner<'tcx>>],
_binders: &CanonicalVarKinds<RustInterner<'tcx>>
) -> Vec<ImplId<RustInterner<'tcx>>>
Returns a list of potentially relevant impls for a given
trait-id; we also supply the type parameters that we are
trying to match (if known: these parameters may contain
inference variables, for example). The implementor is
permitted to return any superset of the applicable impls;
chalk will narrow down the list to only those that truly
apply. The parameters are provided as a “hint” to help the
implementor do less work, but can be completely ignored if
desired. Read more
source§fn impl_provided_for(
&self,
auto_trait_id: TraitId<RustInterner<'tcx>>,
chalk_ty: &TyKind<RustInterner<'tcx>>
) -> bool
fn impl_provided_for(
&self,
auto_trait_id: TraitId<RustInterner<'tcx>>,
chalk_ty: &TyKind<RustInterner<'tcx>>
) -> bool
Returns true if there is an explicit impl of the auto trait
auto_trait_id
for the type ty
. This is part of
the auto trait handling – if there is no explicit impl given
by the user for ty
, then we provide default impls
(otherwise, we rely on the impls the user gave). Read moresource§fn associated_ty_value(
&self,
associated_ty_id: AssociatedTyValueId<RustInterner<'tcx>>
) -> Arc<AssociatedTyValue<RustInterner<'tcx>>>
fn associated_ty_value(
&self,
associated_ty_id: AssociatedTyValueId<RustInterner<'tcx>>
) -> Arc<AssociatedTyValue<RustInterner<'tcx>>>
Returns the
AssociatedTyValue
with the given id.source§fn custom_clauses(&self) -> Vec<ProgramClause<RustInterner<'tcx>>>
fn custom_clauses(&self) -> Vec<ProgramClause<RustInterner<'tcx>>>
Returns any “custom program clauses” that do not derive from
Rust IR. Used only in testing the underlying solver. Read more
source§fn local_impls_to_coherence_check(
&self,
_trait_id: TraitId<RustInterner<'tcx>>
) -> Vec<ImplId<RustInterner<'tcx>>>
fn local_impls_to_coherence_check(
&self,
_trait_id: TraitId<RustInterner<'tcx>>
) -> Vec<ImplId<RustInterner<'tcx>>>
Returns the impls that require coherence checking. This is not the
full set of impls that exist: Read more
source§fn opaque_ty_data(
&self,
opaque_ty_id: OpaqueTyId<RustInterner<'tcx>>
) -> Arc<OpaqueTyDatum<RustInterner<'tcx>>>
fn opaque_ty_data(
&self,
opaque_ty_id: OpaqueTyId<RustInterner<'tcx>>
) -> Arc<OpaqueTyDatum<RustInterner<'tcx>>>
Returns the
OpaqueTyDatum
with the given id.source§fn program_clauses_for_env(
&self,
environment: &Environment<RustInterner<'tcx>>
) -> ProgramClauses<RustInterner<'tcx>>
fn program_clauses_for_env(
&self,
environment: &Environment<RustInterner<'tcx>>
) -> ProgramClauses<RustInterner<'tcx>>
Calculates program clauses from an env. This is intended to call the
program_clauses_for_env
function and then possibly cache the clauses. Read moresource§fn well_known_trait_id(
&self,
well_known_trait: WellKnownTrait
) -> Option<TraitId<RustInterner<'tcx>>>
fn well_known_trait_id(
&self,
well_known_trait: WellKnownTrait
) -> Option<TraitId<RustInterner<'tcx>>>
Returns id of a trait lang item, if found
source§fn is_object_safe(&self, trait_id: TraitId<RustInterner<'tcx>>) -> bool
fn is_object_safe(&self, trait_id: TraitId<RustInterner<'tcx>>) -> bool
Check if a trait is object safe
Returns the “hidden type” corresponding with the opaque type.
source§fn closure_kind(
&self,
_closure_id: ClosureId<RustInterner<'tcx>>,
substs: &Substitution<RustInterner<'tcx>>
) -> ClosureKind
fn closure_kind(
&self,
_closure_id: ClosureId<RustInterner<'tcx>>,
substs: &Substitution<RustInterner<'tcx>>
) -> ClosureKind
Gets the
ClosureKind
for a given closure and substitution.source§fn closure_inputs_and_output(
&self,
_closure_id: ClosureId<RustInterner<'tcx>>,
substs: &Substitution<RustInterner<'tcx>>
) -> Binders<FnDefInputsAndOutputDatum<RustInterner<'tcx>>>
fn closure_inputs_and_output(
&self,
_closure_id: ClosureId<RustInterner<'tcx>>,
substs: &Substitution<RustInterner<'tcx>>
) -> Binders<FnDefInputsAndOutputDatum<RustInterner<'tcx>>>
Gets the inputs and output for a given closure id and substitution. We
pass both the
ClosureId
and it’s Substituion
to give implementors
the freedom to store associated data in the substitution (like rustc) or
separately (like chalk-integration). Read moresource§fn closure_upvars(
&self,
_closure_id: ClosureId<RustInterner<'tcx>>,
substs: &Substitution<RustInterner<'tcx>>
) -> Binders<Ty<RustInterner<'tcx>>>
fn closure_upvars(
&self,
_closure_id: ClosureId<RustInterner<'tcx>>,
substs: &Substitution<RustInterner<'tcx>>
) -> Binders<Ty<RustInterner<'tcx>>>
Gets the upvars as a
Ty
for a given closure id and substitution. There
are no restrictions on the type of upvars. Read moresource§fn closure_fn_substitution(
&self,
_closure_id: ClosureId<RustInterner<'tcx>>,
substs: &Substitution<RustInterner<'tcx>>
) -> Substitution<RustInterner<'tcx>>
fn closure_fn_substitution(
&self,
_closure_id: ClosureId<RustInterner<'tcx>>,
substs: &Substitution<RustInterner<'tcx>>
) -> Substitution<RustInterner<'tcx>>
Gets the substitution for the closure when used as a function.
For example, for the following (not-quite-)rust code: Read more
source§fn generator_datum(
&self,
_generator_id: GeneratorId<RustInterner<'tcx>>
) -> Arc<GeneratorDatum<RustInterner<'tcx>>>
fn generator_datum(
&self,
_generator_id: GeneratorId<RustInterner<'tcx>>
) -> Arc<GeneratorDatum<RustInterner<'tcx>>>
Returns the generator datum for the generator with the given id.
source§fn generator_witness_datum(
&self,
_generator_id: GeneratorId<RustInterner<'tcx>>
) -> Arc<GeneratorWitnessDatum<RustInterner<'tcx>>>
fn generator_witness_datum(
&self,
_generator_id: GeneratorId<RustInterner<'tcx>>
) -> Arc<GeneratorWitnessDatum<RustInterner<'tcx>>>
Returns the generator witness datum for the generator with the given id.
fn unification_database(&self) -> &dyn UnificationDatabase<RustInterner<'tcx>>
fn discriminant_type(&self, _: Ty<RustInterner<'tcx>>) -> Ty<RustInterner<'tcx>>
source§fn trait_name(&self, trait_id: TraitId<I>) -> String
fn trait_name(&self, trait_id: TraitId<I>) -> String
Retrieves a trait’s original name. No uniqueness guarantees, but must
a valid Rust identifier. Read more
source§fn adt_name(&self, adt_id: AdtId<I>) -> String
fn adt_name(&self, adt_id: AdtId<I>) -> String
Retrieves a struct’s original name. No uniqueness guarantees, but must
a valid Rust identifier. Read more
source§fn assoc_type_name(&self, assoc_ty_id: AssocTypeId<I>) -> String
fn assoc_type_name(&self, assoc_ty_id: AssocTypeId<I>) -> String
Retrieves the name of an associated type. No uniqueness guarantees, but must
a valid Rust identifier. Read more
source§fn opaque_type_name(&self, opaque_ty_id: OpaqueTyId<I>) -> String
fn opaque_type_name(&self, opaque_ty_id: OpaqueTyId<I>) -> String
Retrieves the name of an opaque type. No uniqueness guarantees, but must
a valid Rust identifier. Read more
source§impl<'tcx> UnificationDatabase<RustInterner<'tcx>> for RustIrDatabase<'tcx>
impl<'tcx> UnificationDatabase<RustInterner<'tcx>> for RustIrDatabase<'tcx>
source§fn fn_def_variance(
&self,
def_id: FnDefId<RustInterner<'tcx>>
) -> Variances<RustInterner<'tcx>>
fn fn_def_variance(
&self,
def_id: FnDefId<RustInterner<'tcx>>
) -> Variances<RustInterner<'tcx>>
Gets the variances for the substitution of a fn def
source§fn adt_variance(
&self,
adt_id: AdtId<RustInterner<'tcx>>
) -> Variances<RustInterner<'tcx>>
fn adt_variance(
&self,
adt_id: AdtId<RustInterner<'tcx>>
) -> Variances<RustInterner<'tcx>>
Gets the variances for the substitution of a adt
Auto Trait Implementations§
impl<'tcx> !RefUnwindSafe for RustIrDatabase<'tcx>
impl<'tcx> !Send for RustIrDatabase<'tcx>
impl<'tcx> !Sync for RustIrDatabase<'tcx>
impl<'tcx> Unpin for RustIrDatabase<'tcx>
impl<'tcx> !UnwindSafe for RustIrDatabase<'tcx>
Blanket Implementations§
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: 8 bytes