Avoid over-eager disjoint variable merging during lambda set compaction

During the unspecialized lambda set compaction procedure, we might end
up trying to merge too many disjoint variables during unspecialized
lambda unification. Avoid doing so, by checking if we're in the
compaction procedure.
This commit is contained in:
Ayaz Hafiz 2022-07-26 18:24:22 -04:00
parent bda52b0d39
commit ff4b5f58ab
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
3 changed files with 62 additions and 10 deletions

View file

@ -579,9 +579,13 @@ fn compact_lambda_set<P: Phase>(
// 3. Unify `t_f1 ~ t_f2`.
trace_compact!(3iter_start. subs, this_lambda_set, t_f1, t_f2);
let (vars, new_obligations, new_lambda_sets_to_specialize, _meta) =
unify(&mut UEnv::new(subs), t_f1, t_f2, Mode::EQ)
.expect_success("ambient functions don't unify");
let (vars, new_obligations, new_lambda_sets_to_specialize, _meta) = unify(
&mut UEnv::new(subs),
t_f1,
t_f2,
Mode::LAMBDA_SET_SPECIALIZATION,
)
.expect_success("ambient functions don't unify");
trace_compact!(3iter_end. subs, t_f1);
introduce(subs, target_rank, pools, &vars);