From db1dfb2f36be40eb3ae5aff982f1f6ac34452883 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 4 Jun 2019 12:27:56 -0400 Subject: [PATCH] rename `evaluate_obligation_recursively` It does not, in fact, execute in a recursive context. --- src/librustc/traits/query/evaluate_obligation.rs | 2 +- src/librustc/traits/select.rs | 9 +++++---- src/librustc_traits/evaluate_obligation.rs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/librustc/traits/query/evaluate_obligation.rs b/src/librustc/traits/query/evaluate_obligation.rs index d5230f15c25..5f1af668a9e 100644 --- a/src/librustc/traits/query/evaluate_obligation.rs +++ b/src/librustc/traits/query/evaluate_obligation.rs @@ -64,7 +64,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> { Err(OverflowError) => { let mut selcx = SelectionContext::with_query_mode(&self, TraitQueryMode::Standard); - selcx.evaluate_obligation_recursively(obligation) + selcx.evaluate_root_obligation(obligation) .unwrap_or_else(|r| { span_bug!( obligation.cause.span, diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index 7810d65e88c..503e0db548e 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -649,14 +649,15 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { // where we do not expect overflow to be propagated. assert!(self.query_mode == TraitQueryMode::Standard); - self.evaluate_obligation_recursively(obligation) + self.evaluate_root_obligation(obligation) .expect("Overflow should be caught earlier in standard query mode") .may_apply() } - /// Evaluates whether the obligation `obligation` can be satisfied and returns - /// an `EvaluationResult`. - pub fn evaluate_obligation_recursively( + /// Evaluates whether the obligation `obligation` can be satisfied + /// and returns an `EvaluationResult`. This is meant for the + /// *initial* call. + pub fn evaluate_root_obligation( &mut self, obligation: &PredicateObligation<'tcx>, ) -> Result { diff --git a/src/librustc_traits/evaluate_obligation.rs b/src/librustc_traits/evaluate_obligation.rs index 83aebd16e24..59b743abaf1 100644 --- a/src/librustc_traits/evaluate_obligation.rs +++ b/src/librustc_traits/evaluate_obligation.rs @@ -29,7 +29,7 @@ fn evaluate_obligation<'tcx>( let mut selcx = SelectionContext::with_query_mode(&infcx, TraitQueryMode::Canonical); let obligation = Obligation::new(ObligationCause::dummy(), param_env, predicate); - selcx.evaluate_obligation_recursively(&obligation) + selcx.evaluate_root_obligation(&obligation) }, ) }