fix: evaluate with wrong obligation stack

This commit is contained in:
yifei 2023-03-08 20:12:46 +08:00
parent 38b9655311
commit 204ba3224e
3 changed files with 47 additions and 2 deletions

View file

@ -1083,7 +1083,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
let mut nested_result = EvaluationResult::EvaluatedToOk;
for obligation in nested_obligations {
nested_result = cmp::max(
this.evaluate_predicate_recursively(stack.list(), obligation)?,
this.evaluate_predicate_recursively(previous_stack, obligation)?,
nested_result,
);
}
@ -1092,7 +1092,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
let obligation = obligation.with(this.tcx(), predicate);
result = cmp::max(
nested_result,
this.evaluate_trait_predicate_recursively(stack.list(), obligation)?,
this.evaluate_trait_predicate_recursively(previous_stack, obligation)?,
);
}
}