Skip to content

Commit db1dfb2

Browse files
committed
rename evaluate_obligation_recursively
It does not, in fact, execute in a recursive context.
1 parent 8e948df commit db1dfb2

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/librustc/traits/query/evaluate_obligation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
6464
Err(OverflowError) => {
6565
let mut selcx =
6666
SelectionContext::with_query_mode(&self, TraitQueryMode::Standard);
67-
selcx.evaluate_obligation_recursively(obligation)
67+
selcx.evaluate_root_obligation(obligation)
6868
.unwrap_or_else(|r| {
6969
span_bug!(
7070
obligation.cause.span,

src/librustc/traits/select.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,14 +649,15 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
649649
// where we do not expect overflow to be propagated.
650650
assert!(self.query_mode == TraitQueryMode::Standard);
651651

652-
self.evaluate_obligation_recursively(obligation)
652+
self.evaluate_root_obligation(obligation)
653653
.expect("Overflow should be caught earlier in standard query mode")
654654
.may_apply()
655655
}
656656

657-
/// Evaluates whether the obligation `obligation` can be satisfied and returns
658-
/// an `EvaluationResult`.
659-
pub fn evaluate_obligation_recursively(
657+
/// Evaluates whether the obligation `obligation` can be satisfied
658+
/// and returns an `EvaluationResult`. This is meant for the
659+
/// *initial* call.
660+
pub fn evaluate_root_obligation(
660661
&mut self,
661662
obligation: &PredicateObligation<'tcx>,
662663
) -> Result<EvaluationResult, OverflowError> {

src/librustc_traits/evaluate_obligation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn evaluate_obligation<'tcx>(
2929
let mut selcx = SelectionContext::with_query_mode(&infcx, TraitQueryMode::Canonical);
3030
let obligation = Obligation::new(ObligationCause::dummy(), param_env, predicate);
3131

32-
selcx.evaluate_obligation_recursively(&obligation)
32+
selcx.evaluate_root_obligation(&obligation)
3333
},
3434
)
3535
}

0 commit comments

Comments
 (0)