pub struct InferenceData<'db> {
pub inference_id: InferenceId<'db>,
pub type_assignment: OrderedHashMap<LocalTypeVarId, TypeId<'db>>,
pub const_assignment: OrderedHashMap<LocalConstVarId, ConstValueId<'db>>,
pub impl_assignment: OrderedHashMap<LocalImplVarId, ImplId<'db>>,
pub negative_impl_assignment: OrderedHashMap<LocalNegativeImplVarId, NegativeImplId<'db>>,
pub impl_vars_trait_item_mappings: HashMap<LocalImplVarId, ImplVarTraitItemMappings<'db>>,
pub type_vars: Vec<TypeVar<'db>>,
pub const_vars: Vec<ConstVar<'db>>,
pub impl_vars: Vec<ImplVar<'db>>,
pub negative_impl_vars: Vec<NegativeImplVar<'db>>,
pub stable_ptrs: HashMap<InferenceVar, SyntaxStablePtrId<'db>>,
pub impl_type_bounds: Arc<BTreeMap<ImplTypeById<'db>, TypeId<'db>>>,
/* private fields */
}Expand description
State of inference.
Fields§
§inference_id: InferenceId<'db>§type_assignment: OrderedHashMap<LocalTypeVarId, TypeId<'db>>Current inferred assignment for type variables.
const_assignment: OrderedHashMap<LocalConstVarId, ConstValueId<'db>>Current inferred assignment for const variables.
impl_assignment: OrderedHashMap<LocalImplVarId, ImplId<'db>>Current inferred assignment for impl variables.
negative_impl_assignment: OrderedHashMap<LocalNegativeImplVarId, NegativeImplId<'db>>Current inferred assignment for negative impl variables.
impl_vars_trait_item_mappings: HashMap<LocalImplVarId, ImplVarTraitItemMappings<'db>>Unsolved impl variables mapping to a maps of trait items to a corresponding item variable. Upon solution of the trait conforms the fully known item to the variable.
type_vars: Vec<TypeVar<'db>>Type variables.
const_vars: Vec<ConstVar<'db>>Const variables.
impl_vars: Vec<ImplVar<'db>>Impl variables.
negative_impl_vars: Vec<NegativeImplVar<'db>>Negative impl variables.
stable_ptrs: HashMap<InferenceVar, SyntaxStablePtrId<'db>>Mapping from variables to stable pointers, if exist.
impl_type_bounds: Arc<BTreeMap<ImplTypeById<'db>, TypeId<'db>>>Mapping from impl types to type variables.
Implementations§
Source§impl<'db> InferenceData<'db>
impl<'db> InferenceData<'db>
pub fn new(inference_id: InferenceId<'db>) -> Self
pub fn inference<'r>(&'r mut self, db: &'db dyn Database) -> Inference<'db, 'r>
pub fn clone_with_inference_id( &self, db: &'db dyn Database, inference_id: InferenceId<'db>, ) -> InferenceData<'db>
pub fn temporary_clone(&self) -> InferenceData<'db>
Trait Implementations§
Source§impl<'db> Debug for InferenceData<'db>
impl<'db> Debug for InferenceData<'db>
Source§impl<'db> DebugWithDb<'db> for InferenceData<'db>
impl<'db> DebugWithDb<'db> for InferenceData<'db>
type Db = dyn Database
fn fmt(&self, f: &mut Formatter<'_>, db: &'db dyn Database) -> Result
fn debug<'me>(&'me self, db: &'db Self::Db) -> DebugWith<'me, 'db, Self::Db>where
Self: Sized + 'me,
fn into_debug<'me>(self, db: &'db Self::Db) -> DebugWith<'me, 'db, Self::Db>where
Self: Sized + 'me,
Source§impl<'db> PartialEq for InferenceData<'db>
impl<'db> PartialEq for InferenceData<'db>
Source§impl<'db> Update for InferenceData<'db>
impl<'db> Update for InferenceData<'db>
impl<'db> Eq for InferenceData<'db>
impl<'db> StructuralPartialEq for InferenceData<'db>
Auto Trait Implementations§
impl<'db> Freeze for InferenceData<'db>
impl<'db> RefUnwindSafe for InferenceData<'db>
impl<'db> Send for InferenceData<'db>
impl<'db> Sync for InferenceData<'db>
impl<'db> Unpin for InferenceData<'db>
impl<'db> UnwindSafe for InferenceData<'db>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
fn debug_db_upcast(&'db self) -> &'db T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more