luaur_analysis/methods/
constraint_solver_deprecate_d_emplace_constraint_solver.rs1use crate::functions::as_mutable_type::as_mutable_type_id;
13use crate::functions::emplace_type::emplace_type;
14use crate::functions::get_type_alt_j::get_type_id;
15use crate::records::blocked_type::BlockedType;
16use crate::records::constraint::Constraint;
17use crate::records::constraint_solver::ConstraintSolver;
18use crate::records::free_type::FreeType;
19use crate::records::pending_expansion_type::PendingExpansionType;
20use crate::type_aliases::type_id::TypeId;
21use luaur_common::macros::luau_assert::LUAU_ASSERT;
22
23impl ConstraintSolver {
24 pub fn deprecate_d_emplace_not_null_constraint_type_id_args_item<T, Args>(
25 &mut self,
26 constraint: *const Constraint,
27 ty: TypeId,
28 _args: Args,
29 ) {
30 LUAU_ASSERT!(unsafe {
33 !get_type_id::<BlockedType>(ty).is_null()
34 || !get_type_id::<FreeType>(ty).is_null()
35 || !get_type_id::<PendingExpansionType>(ty).is_null()
36 });
37
38 let mutable_ty = unsafe { as_mutable_type_id(ty) };
39 let _ = unsafe { emplace_type::<T>(mutable_ty) };
40
41 let location = unsafe { (*constraint).location };
42 self.unblock_type_id_location(ty, location);
43 }
44}