Struct chalk_solve::logging_db::LoggingRustIrDatabase
source · pub struct LoggingRustIrDatabase<I, DB, P = DB>where
DB: RustIrDatabase<I>,
P: Borrow<DB>,
I: Interner,{ /* private fields */ }Expand description
Wraps another RustIrDatabase (DB) and records which definitions are
used.
A full .chalk file containing all used definitions can be recovered through
LoggingRustIrDatabase’s Display implementation.
Uses a separate type, P, for the database stored inside to account for
Arc or wrapping other storage mediums.
Implementations
sourceimpl<I, DB, P> LoggingRustIrDatabase<I, DB, P>where
DB: RustIrDatabase<I>,
P: Borrow<DB>,
I: Interner,
impl<I, DB, P> LoggingRustIrDatabase<I, DB, P>where
DB: RustIrDatabase<I>,
P: Borrow<DB>,
I: Interner,
Trait Implementations
sourceimpl<I: Debug, DB: Debug, P: Debug> Debug for LoggingRustIrDatabase<I, DB, P>where
DB: RustIrDatabase<I>,
P: Borrow<DB>,
I: Interner,
impl<I: Debug, DB: Debug, P: Debug> Debug for LoggingRustIrDatabase<I, DB, P>where
DB: RustIrDatabase<I>,
P: Borrow<DB>,
I: Interner,
sourceimpl<I, DB, P> Display for LoggingRustIrDatabase<I, DB, P>where
DB: RustIrDatabase<I>,
P: Borrow<DB>,
I: Interner,
impl<I, DB, P> Display for LoggingRustIrDatabase<I, DB, P>where
DB: RustIrDatabase<I>,
P: Borrow<DB>,
I: Interner,
sourceimpl<I, DB, P> RustIrDatabase<I> for LoggingRustIrDatabase<I, DB, P>where
DB: RustIrDatabase<I>,
P: Borrow<DB> + Debug,
I: Interner,
impl<I, DB, P> RustIrDatabase<I> for LoggingRustIrDatabase<I, DB, P>where
DB: RustIrDatabase<I>,
P: Borrow<DB> + Debug,
I: Interner,
sourcefn custom_clauses(&self) -> Vec<ProgramClause<I>>ⓘ
fn custom_clauses(&self) -> Vec<ProgramClause<I>>ⓘ
Returns any “custom program clauses” that do not derive from
Rust IR. Used only in testing the underlying solver. Read more
sourcefn associated_ty_data(&self, ty: AssocTypeId<I>) -> Arc<AssociatedTyDatum<I>>
fn associated_ty_data(&self, ty: AssocTypeId<I>) -> Arc<AssociatedTyDatum<I>>
Returns the datum for the associated type with the given id.
sourcefn trait_datum(&self, trait_id: TraitId<I>) -> Arc<TraitDatum<I>>
fn trait_datum(&self, trait_id: TraitId<I>) -> Arc<TraitDatum<I>>
Returns the datum for the definition with the given id.
sourcefn adt_datum(&self, adt_id: AdtId<I>) -> Arc<AdtDatum<I>>
fn adt_datum(&self, adt_id: AdtId<I>) -> Arc<AdtDatum<I>>
Returns the datum for the ADT with the given id.
sourcefn generator_datum(&self, generator_id: GeneratorId<I>) -> Arc<GeneratorDatum<I>>
fn generator_datum(&self, generator_id: GeneratorId<I>) -> Arc<GeneratorDatum<I>>
Returns the generator datum for the generator with the given id.
sourcefn generator_witness_datum(
&self,
generator_id: GeneratorId<I>
) -> Arc<GeneratorWitnessDatum<I>>
fn generator_witness_datum(
&self,
generator_id: GeneratorId<I>
) -> Arc<GeneratorWitnessDatum<I>>
Returns the generator witness datum for the generator with the given id.
sourcefn adt_repr(&self, id: AdtId<I>) -> Arc<AdtRepr<I>>
fn adt_repr(&self, id: AdtId<I>) -> Arc<AdtRepr<I>>
Returns the representation for the ADT definition with the given id.
sourcefn adt_size_align(&self, id: AdtId<I>) -> Arc<AdtSizeAlign>
fn adt_size_align(&self, id: AdtId<I>) -> Arc<AdtSizeAlign>
Returns the siza and alignment of the ADT definition with the given id.
sourcefn impl_datum(&self, impl_id: ImplId<I>) -> Arc<ImplDatum<I>>
fn impl_datum(&self, impl_id: ImplId<I>) -> Arc<ImplDatum<I>>
Returns the datum for the impl with the given id.
Returns the “hidden type” corresponding with the opaque type.
sourcefn associated_ty_value(
&self,
id: AssociatedTyValueId<I>
) -> Arc<AssociatedTyValue<I>>
fn associated_ty_value(
&self,
id: AssociatedTyValueId<I>
) -> Arc<AssociatedTyValue<I>>
Returns the
AssociatedTyValue with the given id.sourcefn opaque_ty_data(&self, id: OpaqueTyId<I>) -> Arc<OpaqueTyDatum<I>>
fn opaque_ty_data(&self, id: OpaqueTyId<I>) -> Arc<OpaqueTyDatum<I>>
Returns the
OpaqueTyDatum with the given id.sourcefn impls_for_trait(
&self,
trait_id: TraitId<I>,
parameters: &[GenericArg<I>],
binders: &CanonicalVarKinds<I>
) -> Vec<ImplId<I>>ⓘ
fn impls_for_trait(
&self,
trait_id: TraitId<I>,
parameters: &[GenericArg<I>],
binders: &CanonicalVarKinds<I>
) -> Vec<ImplId<I>>ⓘ
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
sourcefn local_impls_to_coherence_check(&self, trait_id: TraitId<I>) -> Vec<ImplId<I>>ⓘ
fn local_impls_to_coherence_check(&self, trait_id: TraitId<I>) -> Vec<ImplId<I>>ⓘ
Returns the impls that require coherence checking. This is not the
full set of impls that exist: Read more
sourcefn impl_provided_for(&self, auto_trait_id: TraitId<I>, ty: &TyKind<I>) -> bool
fn impl_provided_for(&self, auto_trait_id: TraitId<I>, ty: &TyKind<I>) -> 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 moresourcefn well_known_trait_id(
&self,
well_known_trait: WellKnownTrait
) -> Option<TraitId<I>>
fn well_known_trait_id(
&self,
well_known_trait: WellKnownTrait
) -> Option<TraitId<I>>
Returns id of a trait lang item, if found
sourcefn program_clauses_for_env(
&self,
environment: &Environment<I>
) -> ProgramClauses<I>
fn program_clauses_for_env(
&self,
environment: &Environment<I>
) -> ProgramClauses<I>
Calculates program clauses from an env. This is intended to call the
program_clauses_for_env function and then possibly cache the clauses. Read morefn interner(&self) -> I
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn is_object_safe(&self, trait_id: TraitId<I>) -> bool
fn is_object_safe(&self, trait_id: TraitId<I>) -> bool
Check if a trait is object safe
sourcefn fn_def_datum(&self, fn_def_id: FnDefId<I>) -> Arc<FnDefDatum<I>>
fn fn_def_datum(&self, fn_def_id: FnDefId<I>) -> Arc<FnDefDatum<I>>
Returns the datum for the fn definition with the given id.
sourcefn fn_def_name(&self, fn_def_id: FnDefId<I>) -> String
fn fn_def_name(&self, fn_def_id: FnDefId<I>) -> String
Retrieves the name of a function definition. No uniqueness guarantees, but must
a valid Rust identifier. Read more
sourcefn closure_kind(
&self,
closure_id: ClosureId<I>,
substs: &Substitution<I>
) -> ClosureKind
fn closure_kind(
&self,
closure_id: ClosureId<I>,
substs: &Substitution<I>
) -> ClosureKind
Gets the
ClosureKind for a given closure and substitution.sourcefn closure_inputs_and_output(
&self,
closure_id: ClosureId<I>,
substs: &Substitution<I>
) -> Binders<FnDefInputsAndOutputDatum<I>>
fn closure_inputs_and_output(
&self,
closure_id: ClosureId<I>,
substs: &Substitution<I>
) -> Binders<FnDefInputsAndOutputDatum<I>>
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 moresourcefn closure_upvars(
&self,
closure_id: ClosureId<I>,
substs: &Substitution<I>
) -> Binders<Ty<I>>
fn closure_upvars(
&self,
closure_id: ClosureId<I>,
substs: &Substitution<I>
) -> Binders<Ty<I>>
Gets the upvars as a
Ty for a given closure id and substitution. There
are no restrictions on the type of upvars. Read moresourcefn closure_fn_substitution(
&self,
closure_id: ClosureId<I>,
substs: &Substitution<I>
) -> Substitution<I>
fn closure_fn_substitution(
&self,
closure_id: ClosureId<I>,
substs: &Substitution<I>
) -> Substitution<I>
Gets the substitution for the closure when used as a function.
For example, for the following (not-quite-)rust code: Read more
fn discriminant_type(&self, ty: Ty<I>) -> Ty<I>
fn unification_database(&self) -> &dyn UnificationDatabase<I>
sourceimpl<I, DB, P> UnificationDatabase<I> for LoggingRustIrDatabase<I, DB, P>where
DB: RustIrDatabase<I>,
P: Borrow<DB> + Debug,
I: Interner,
impl<I, DB, P> UnificationDatabase<I> for LoggingRustIrDatabase<I, DB, P>where
DB: RustIrDatabase<I>,
P: Borrow<DB> + Debug,
I: Interner,
sourcefn fn_def_variance(&self, fn_def_id: FnDefId<I>) -> Variances<I>
fn fn_def_variance(&self, fn_def_id: FnDefId<I>) -> Variances<I>
Gets the variances for the substitution of a fn def
sourcefn adt_variance(&self, adt_id: AdtId<I>) -> Variances<I>
fn adt_variance(&self, adt_id: AdtId<I>) -> Variances<I>
Gets the variances for the substitution of a adt
Auto Trait Implementations
impl<I, DB, P> RefUnwindSafe for LoggingRustIrDatabase<I, DB, P>where
DB: RefUnwindSafe,
P: RefUnwindSafe,
impl<I, DB, P> Send for LoggingRustIrDatabase<I, DB, P>where
DB: Send,
P: Send,
<I as Interner>::DefId: Send,
<I as Interner>::InternedAdtId: Send,
impl<I, DB, P> Sync for LoggingRustIrDatabase<I, DB, P>where
DB: Sync,
P: Sync,
<I as Interner>::DefId: Send,
<I as Interner>::InternedAdtId: Send,
impl<I, DB, P> Unpin for LoggingRustIrDatabase<I, DB, P>where
DB: Unpin,
P: Unpin,
<I as Interner>::DefId: Unpin,
<I as Interner>::InternedAdtId: Unpin,
impl<I, DB, P> UnwindSafe for LoggingRustIrDatabase<I, DB, P>where
DB: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Cast for T
impl<T> Cast for T
sourcefn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
Cast a value to type
U using CastTo.sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<DB, I> Split<I> for DBwhere
DB: RustIrDatabase<I> + ?Sized,
I: Interner,
impl<DB, I> Split<I> for DBwhere
DB: RustIrDatabase<I> + ?Sized,
I: Interner,
sourcefn split_projection<'p>(
&self,
projection: &'p ProjectionTy<I>
) -> (Arc<AssociatedTyDatum<I>>, &'p [GenericArg<I>], &'p [GenericArg<I>])
fn split_projection<'p>(
&self,
projection: &'p ProjectionTy<I>
) -> (Arc<AssociatedTyDatum<I>>, &'p [GenericArg<I>], &'p [GenericArg<I>])
Given a projection of an associated type, split the type
parameters into those that come from the trait and those
that come from the associated type itself. So e.g. if you
have
(Iterator::Item)<F>, this would return ([F], []),
since Iterator::Item is not generic and hence doesn’t have
any type parameters itself. Read moresourcefn trait_parameters_from_projection<'p>(
&self,
projection: &'p ProjectionTy<I>
) -> &'p [GenericArg<I>]
fn trait_parameters_from_projection<'p>(
&self,
projection: &'p ProjectionTy<I>
) -> &'p [GenericArg<I>]
Given a projection
<P0 as Trait<P1..Pn>>::Item<Pn..Pm>,
returns the trait parameters [P0..Pn] (see
split_projection). Read moresourcefn trait_ref_from_projection(&self, projection: &ProjectionTy<I>) -> TraitRef<I>
fn trait_ref_from_projection(&self, projection: &ProjectionTy<I>) -> TraitRef<I>
Given a projection
<P0 as Trait<P1..Pn>>::Item<Pn..Pm>,
returns the trait parameters [P0..Pn] (see
split_projection). Read moresourcefn split_associated_ty_value_parameters<'p, P>(
&self,
parameters: &'p [P],
associated_ty_value: &AssociatedTyValue<I>
) -> (&'p [P], &'p [P])
fn split_associated_ty_value_parameters<'p, P>(
&self,
parameters: &'p [P],
associated_ty_value: &AssociatedTyValue<I>
) -> (&'p [P], &'p [P])
Given the full set of parameters (or binders) for an
associated type value (which appears in an impl), splits
them into the substitutions for the impl and those for the
associated type. Read more
sourcefn impl_parameters_and_projection_from_associated_ty_value<'p>(
&self,
parameters: &'p [GenericArg<I>],
associated_ty_value: &AssociatedTyValue<I>
) -> (&'p [GenericArg<I>], ProjectionTy<I>)
fn impl_parameters_and_projection_from_associated_ty_value<'p>(
&self,
parameters: &'p [GenericArg<I>],
associated_ty_value: &AssociatedTyValue<I>
) -> (&'p [GenericArg<I>], ProjectionTy<I>)
Given the full set of parameters for an associated type value
(which appears in an impl), returns the trait reference
and projection that are being satisfied by that value. Read more
sourcefn split_associated_ty_parameters<'p, P>(
&self,
parameters: &'p [P],
associated_ty_datum: &AssociatedTyDatum<I>
) -> (&'p [P], &'p [P])
fn split_associated_ty_parameters<'p, P>(
&self,
parameters: &'p [P],
associated_ty_datum: &AssociatedTyDatum<I>
) -> (&'p [P], &'p [P])
Given the full set of parameters (or binders) for an
associated type datum (the one appearing in a trait), splits
them into the parameters for the trait and those for the
associated type. Read more