pub struct ConstraintSolver {Show 33 fields
pub arena: *mut TypeArena,
pub builtin_types: *mut BuiltinTypes,
pub ice_reporter: InternalErrorReporter,
pub normalizer: *mut Normalizer,
pub type_function_runtime: *mut TypeFunctionRuntime,
pub constraint_set: ConstraintSet,
pub constraints: Vec<*mut Constraint>,
pub scope_to_function: *mut DenseHashMap<*mut Scope, TypeId>,
pub root_scope: *mut Scope,
pub module: Option<ModulePtr>,
pub dfg: *const DataFlowGraph,
pub solver_constraints: Vec<Box<Constraint>>,
pub solver_constraint_limit: usize,
pub unsolved_constraints: Vec<*const Constraint>,
pub deprecated_blocked_constraints: HashMap<*const Constraint, usize>,
pub deprecated_blocked: HashMap<BlockedConstraintId, DenseHashSet<*const Constraint>>,
pub instantiated_aliases: DenseHashMap<InstantiationSignature, TypeId, HashInstantiationSignature>,
pub upper_bound_contributors: DenseHashMap<TypeId, Vec<(Location, TypeId)>>,
pub deprecated_type_to_constraint_set: HashMap<TypeId, HashSet<*const Constraint>>,
pub deprecated_constraint_to_mutated_types: DenseHashMap<*const Constraint, TypeIds>,
pub uninhabited_type_functions: DenseHashSet<*const c_void>,
pub seen_constraints: DenseHashMap<SubtypeConstraintRecord, *mut Constraint, HashSubtypeConstraintRecord>,
pub generalized_types_: DenseHashSet<TypeId>,
pub generalized_types: *const DenseHashSet<TypeId>,
pub errors: ErrorVec,
pub module_resolver: *mut ModuleResolver,
pub require_cycles: Vec<RequireCycle>,
pub logger: *mut DcrLogger,
pub limits: TypeCheckLimits,
pub type_functions_to_finalize: DenseHashMap<TypeId, *const Constraint>,
pub opts: ToStringOptions,
pub cgraph: *mut ConstraintGraph,
pub subtyping: *mut Subtyping,
}Fields§
§arena: *mut TypeArena§builtin_types: *mut BuiltinTypes§ice_reporter: InternalErrorReporter§normalizer: *mut Normalizer§type_function_runtime: *mut TypeFunctionRuntime§constraint_set: ConstraintSet§constraints: Vec<*mut Constraint>§scope_to_function: *mut DenseHashMap<*mut Scope, TypeId>§root_scope: *mut Scope§module: Option<ModulePtr>§dfg: *const DataFlowGraph§solver_constraints: Vec<Box<Constraint>>§solver_constraint_limit: usize§unsolved_constraints: Vec<*const Constraint>§deprecated_blocked_constraints: HashMap<*const Constraint, usize>§deprecated_blocked: HashMap<BlockedConstraintId, DenseHashSet<*const Constraint>>§instantiated_aliases: DenseHashMap<InstantiationSignature, TypeId, HashInstantiationSignature>§upper_bound_contributors: DenseHashMap<TypeId, Vec<(Location, TypeId)>>§deprecated_type_to_constraint_set: HashMap<TypeId, HashSet<*const Constraint>>§deprecated_constraint_to_mutated_types: DenseHashMap<*const Constraint, TypeIds>§uninhabited_type_functions: DenseHashSet<*const c_void>§seen_constraints: DenseHashMap<SubtypeConstraintRecord, *mut Constraint, HashSubtypeConstraintRecord>§generalized_types_: DenseHashSet<TypeId>§generalized_types: *const DenseHashSet<TypeId>§errors: ErrorVec§module_resolver: *mut ModuleResolver§require_cycles: Vec<RequireCycle>§logger: *mut DcrLogger§limits: TypeCheckLimits§type_functions_to_finalize: DenseHashMap<TypeId, *const Constraint>§opts: ToStringOptions§cgraph: *mut ConstraintGraph§subtyping: *mut SubtypingImplementations§
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn anyify_module_return_type_pack_generics( &mut self, tp: TypePackId, ) -> TypePackId
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn bind_not_null_constraint_type_id_type_id( &mut self, constraint: *const Constraint, ty: TypeId, bound_to: TypeId, )
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn bind_not_null_constraint_type_pack_id_type_pack_id( &mut self, constraint: *const Constraint, tp: TypePackId, bound_to: TypePackId, )
Source§impl ConstraintSolver
impl ConstraintSolver
Sourcepub fn block_t_not_null_constraint<T>(
&mut self,
_targets: &T,
_constraint: *const Constraint,
) -> bool
pub fn block_t_not_null_constraint<T>( &mut self, _targets: &T, _constraint: *const Constraint, ) -> bool
C++ template<typename T> bool block(const T& targets, NotNull<const Constraint> constraint)
iterates targets (a TypeId range) and forwards each to block(TypeId, ...).
In the Rust port the callers are monomorphized onto
block_type_id_not_null_constraint / block_type_pack_id_not_null_constraint
(and direct loops over the container), so this unbounded template generic has
no call site and no iterable bound to port faithfully.
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn block_not_null_constraint_not_null_constraint( &mut self, target: *const Constraint, constraint: *const Constraint, )
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn block_type_id_not_null_constraint( &mut self, target: TypeId, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn block_type_pack_id_not_null_constraint( &mut self, target: TypePackId, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn constraint_solver_not_null_normalizer_not_null_type_function_runtime_module_ptr_not_null_module_resolver_vector_require_cycle_dcr_logger_not_null_data_flow_graph_type_check_limits_constraint_graph_not_null_subtyping( normalizer: *const Normalizer, type_function_runtime: *const TypeFunctionRuntime, module: ModulePtr, module_resolver: *const ModuleResolver, require_cycles: Vec<RequireCycle>, logger: *mut DcrLogger, dfg: *const DataFlowGraph, limits: TypeCheckLimits, constraint_set: ConstraintSet, cgraph: *mut ConstraintGraph, subtyping: *const Subtyping, ) -> Self
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn constraint_solver_not_null_normalizer_not_null_type_function_runtime_not_null_scope_vector_not_null_constraint_not_null_dense_hash_map_scope_type_id_module_ptr_not_null_module_resolver_vector_require_cycle_dcr_logger_not_null_data_flow_graph_type_check_limits_constraint_graph_not_null_subtyping( normalizer: *const Normalizer, type_function_runtime: *const TypeFunctionRuntime, root_scope: NonNull<Scope>, constraints: Vec<NonNull<Constraint>>, scope_to_function: NonNull<DenseHashMap<*mut Scope, TypeId>>, module: ModulePtr, module_resolver: *const ModuleResolver, require_cycles: Vec<RequireCycle>, logger: *mut DcrLogger, dfg: *const DataFlowGraph, limits: TypeCheckLimits, cgraph: *mut ConstraintGraph, subtyping: *const Subtyping, ) -> Self
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn deprecate_d_block( &mut self, target: BlockedConstraintId, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn deprecate_d_emplace_not_null_constraint_type_id_args_item<T, Args>( &mut self, constraint: *const Constraint, ty: TypeId, _args: Args, )
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn deprecate_d_emplace_not_null_constraint_type_pack_id_args_item<T, Args>( &mut self, constraint: *const Constraint, tp: TypePackId, _args: Args, )
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn deprecate_d_is_blocked(&self, constraint: *const Constraint) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn deprecate_d_shift_references(&mut self, source: TypeId, target: TypeId)
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn deprecate_d_unblock_(&mut self, progressed: BlockedConstraintId)
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn constraint_solver_deprecate_d_unblock( &mut self, progressed: *const Constraint, )
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn fill_in_discriminant_types( &mut self, constraint: *const Constraint, discriminant_types: &Vec<Option<TypeId>>, )
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn constraint_solver_finalize_type_functions(&mut self)
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn generalize_one_type(&mut self, ty: TypeId)
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn has_unresolved_constraints(&mut self, ty: TypeId) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn inherit_blocks( &mut self, source: *const Constraint, addition: *const Constraint, )
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn init_free_type_tracking(&mut self)
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn is_blocked_type_id(&self, ty: TypeId) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn is_blocked_type_pack_id(&self, tp: TypePackId) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn lookup_table_prop_not_null_constraint_type_id_string_value_context_bool_bool( &mut self, constraint: *const Constraint, subject_type: TypeId, prop_name: &str, context: ValueContext, in_conditional: bool, suppress_simplification: bool, ) -> TablePropLookupResult
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn lookup_table_prop_not_null_constraint_type_id_string_value_context_bool_bool_set_type_id( &mut self, constraint: *const Constraint, subject_type: TypeId, prop_name: &str, context: ValueContext, in_conditional: bool, suppress_simplification: bool, seen: &mut DenseHashSet<TypeId>, ) -> TablePropLookupResult
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn push_constraint( &mut self, scope: NonNull<Scope>, location: Location, cv: ConstraintV, ) -> NonNull<Constraint>
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn report_error_type_error_data_location( &mut self, data: TypeErrorData, location: &Location, )
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn report_error_type_error(&mut self, e: TypeError)
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn reproduce_constraints( &mut self, scope: NonNull<Scope>, location: Location, subst: &Substitution, )
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn resolve_module( &mut self, info: &ModuleInfo, location: &Location, ) -> TypeId
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn constraint_solver_run(&mut self)
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn constraint_solver_throw_time_limit_error(&self)
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn constraint_solver_throw_user_cancel_error(&self)
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_not_null_constraint_bool( &mut self, constraint: *const Constraint, force: bool, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_subtype_constraint_not_null_constraint( &mut self, c: &SubtypeConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_pack_subtype_constraint_not_null_constraint( &mut self, c: &PackSubtypeConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_generalization_constraint_not_null_constraint( &mut self, c: &GeneralizationConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_iterable_constraint_not_null_constraint_bool( &mut self, c: &IterableConstraint, constraint: *const Constraint, force: bool, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_name_constraint_not_null_constraint( &mut self, c: &NameConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_type_alias_expansion_constraint_not_null_constraint( &mut self, c: &TypeAliasExpansionConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_function_call_constraint_not_null_constraint_bool( &mut self, c: &FunctionCallConstraint, constraint: *const Constraint, _force: bool, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_function_check_constraint_not_null_constraint_bool( &mut self, c: &FunctionCheckConstraint, constraint: *const Constraint, force: bool, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_primitive_type_constraint_not_null_constraint( &mut self, c: &PrimitiveTypeConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_has_prop_constraint_not_null_constraint( &mut self, c: &HasPropConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_has_indexer_constraint_not_null_constraint( &mut self, c: &HasIndexerConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_assign_prop_constraint_not_null_constraint( &mut self, c: &AssignPropConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_assign_index_constraint_not_null_constraint( &mut self, c: &AssignIndexConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_unpack_constraint_not_null_constraint( &mut self, c: &UnpackConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_reduce_constraint_not_null_constraint_bool( &mut self, c: &ReduceConstraint, constraint: *const Constraint, force: bool, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_reduce_pack_constraint_not_null_constraint_bool( &mut self, c: &ReducePackConstraint, constraint: *const Constraint, force: bool, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_equality_constraint_not_null_constraint( &mut self, c: &EqualityConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_simplify_constraint_not_null_constraint_bool( &mut self, c: &SimplifyConstraint, constraint: *const Constraint, force: bool, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_push_function_type_constraint_not_null_constraint( &mut self, c: &PushFunctionTypeConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_type_instantiation_constraint_not_null_constraint( &mut self, c: &TypeInstantiationConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_push_type_constraint_not_null_constraint_bool( &mut self, c: &PushTypeConstraint, constraint: *const Constraint, force: bool, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn constraint_solver_try_dispatch_has_indexer( &mut self, _recursion_depth: &mut i32, constraint: *const Constraint, subject_type: TypeId, index_type: TypeId, result_type: TypeId, _seen: &mut DenseHashSet<TypeId>, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_iterable_function( &mut self, next_ty: TypeId, table_ty: TypeId, c: &IterableConstraint, constraint: *const Constraint, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn try_dispatch_iterable_table( &mut self, iterator_ty: TypeId, c: &IterableConstraint, constraint: *const Constraint, force: bool, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn unblock_type_id_location(&mut self, ty: TypeId, location: Location)
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn unblock_type_pack_id_location( &mut self, tp: TypePackId, _location: Location, )
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn constraint_solver_unify<TID: UnifyTid>( &mut self, constraint: *const Constraint, sub_ty: TID, super_ty: TID, ) -> bool
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn unpack_and_assign( &mut self, dest_types: Vec<TypeId>, src_types: TypePackId, constraint: NonNull<Constraint>, ) -> NonNull<Constraint>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ConstraintSolver
impl !Send for ConstraintSolver
impl !Sync for ConstraintSolver
impl !UnwindSafe for ConstraintSolver
impl Freeze for ConstraintSolver
impl Unpin for ConstraintSolver
impl UnsafeUnpin for ConstraintSolver
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