pub struct InferenceData {
pub inference_id: InferenceId,
pub type_assignment: HashMap<LocalTypeVarId, TypeId>,
pub const_assignment: HashMap<LocalConstVarId, ConstValueId>,
pub impl_assignment: HashMap<LocalImplVarId, ImplId>,
pub impl_vars_trait_item_mappings: HashMap<LocalImplVarId, ImplVarTraitItemMappings>,
pub type_vars: Vec<TypeVar>,
pub const_vars: Vec<ConstVar>,
pub impl_vars: Vec<ImplVar>,
pub stable_ptrs: HashMap<InferenceVar, SyntaxStablePtrId>,
pub impl_type_bounds: OrderedHashMap<ImplTypeId, TypeId>,
pub error_status: Result<(), InferenceErrorStatus>,
/* private fields */
}
Expand description
State of inference.
Fields§
§inference_id: InferenceId
§type_assignment: HashMap<LocalTypeVarId, TypeId>
Current inferred assignment for type variables.
const_assignment: HashMap<LocalConstVarId, ConstValueId>
Current inferred assignment for const variables.
impl_assignment: HashMap<LocalImplVarId, ImplId>
Current inferred assignment for impl variables.
impl_vars_trait_item_mappings: HashMap<LocalImplVarId, ImplVarTraitItemMappings>
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>
Type variables.
const_vars: Vec<ConstVar>
Const variables.
impl_vars: Vec<ImplVar>
Impl variables.
stable_ptrs: HashMap<InferenceVar, SyntaxStablePtrId>
Mapping from variables to stable pointers, if exist.
impl_type_bounds: OrderedHashMap<ImplTypeId, TypeId>
Mapping from impl types to type variables.
error_status: Result<(), InferenceErrorStatus>
The current error status.
Implementations§
source§impl InferenceData
impl InferenceData
pub fn new(inference_id: InferenceId) -> Self
pub fn inference<'db, 'b: 'db>( &'db mut self, db: &'b dyn SemanticGroup, ) -> Inference<'db>
pub fn clone_with_inference_id( &self, db: &dyn SemanticGroup, inference_id: InferenceId, ) -> InferenceData
pub fn temporary_clone(&self) -> InferenceData
Trait Implementations§
source§impl Debug for InferenceData
impl Debug for InferenceData
source§impl<'a, T: ?Sized + Upcast<dyn SemanticGroup + 'static>> DebugWithDb<T> for InferenceData
impl<'a, T: ?Sized + Upcast<dyn SemanticGroup + 'static>> DebugWithDb<T> for InferenceData
source§impl PartialEq for InferenceData
impl PartialEq for InferenceData
impl Eq for InferenceData
impl StructuralPartialEq for InferenceData
Auto Trait Implementations§
impl Freeze for InferenceData
impl RefUnwindSafe for InferenceData
impl Send for InferenceData
impl Sync for InferenceData
impl Unpin for InferenceData
impl UnwindSafe for InferenceData
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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