Skip to content

Commit 1407bef

Browse files
authored
Merge pull request #392 from zaharidichev/zd/flounder-on-truncation
Stop leaking truncated goal
2 parents 4866423 + 8f7e23d commit 1407bef

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

chalk-solve/src/solve/slg.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,7 @@ impl<I: Interner> TruncatingInferenceTable<I> {
348348

349349
impl<I: Interner> context::TruncateOps<SlgContext<I>> for TruncatingInferenceTable<I> {
350350
fn goal_needs_truncation(&mut self, interner: &I, subgoal: &InEnvironment<Goal<I>>) -> bool {
351-
// We only want to check the goal itself. We keep the environment intact.
352-
// See rust-lang/chalk#280
353-
truncate::needs_truncation(interner, &mut self.infer, self.max_size, &subgoal.goal)
351+
truncate::needs_truncation(interner, &mut self.infer, self.max_size, &subgoal)
354352
}
355353

356354
fn answer_needs_truncation(&mut self, interner: &I, subst: &Substitution<I>) -> bool {

tests/test/projection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,8 @@ fn rust_analyzer_regression() {
712712
PI: ParallelIterator
713713
}
714714
}
715-
} yields_all[SolverChoice::slg(4, None)] {
716-
"substitution [], lifetime constraints []"
715+
} yields_first[SolverChoice::slg(4, None)] {
716+
"Floundered"
717717
}
718718
}
719719
}

0 commit comments

Comments
 (0)