pub struct SemaContextInferenceContext {
pub func_sigs: HashMap<Spur, FunctionSig>,
pub struct_types: HashMap<Spur, Type>,
pub enum_types: HashMap<Spur, Type>,
pub method_sigs: HashMap<(StructId, Spur), MethodSig>,
}Expand description
Pre-computed type information for constraint generation.
This struct holds the function, struct, enum, and method signature maps
converted to InferType format for use in Hindley-Milner type inference.
Building this once and reusing it for all function analyses avoids the
O(n²) cost of rebuilding these maps for each function.
Fields§
§func_sigs: HashMap<Spur, FunctionSig>Function signatures with InferType (for constraint generation).
struct_types: HashMap<Spur, Type>Struct types: name -> Type::new_struct(id).
enum_types: HashMap<Spur, Type>Enum types: name -> Type::new_enum(id).
method_sigs: HashMap<(StructId, Spur), MethodSig>Method signatures with InferType: (struct_id, method_name) -> MethodSig.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InferenceContext
impl RefUnwindSafe for InferenceContext
impl Send for InferenceContext
impl Sync for InferenceContext
impl Unpin for InferenceContext
impl UnwindSafe for InferenceContext
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