]> git.lizzy.rs Git - rust.git/commitdiff
rename `evaluate_obligation_recursively`
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 4 Jun 2019 16:27:56 +0000 (12:27 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 11 Jun 2019 23:07:32 +0000 (19:07 -0400)
It does not, in fact, execute in a recursive context.

src/librustc/traits/query/evaluate_obligation.rs
src/librustc/traits/select.rs
src/librustc_traits/evaluate_obligation.rs

index d5230f15c256536bf36d8a80333fa7eee52770a0..5f1af668a9e48b5818f62b40fbcfa4e4dcf69912 100644 (file)
@@ -64,7 +64,7 @@ fn evaluate_obligation_no_overflow(
             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,
index 7810d65e88cc16315c3049ae0e1f0f798ad45e7c..503e0db548e4a2a43d7b4d166a248548fd2af9b5 100644 (file)
@@ -649,14 +649,15 @@ pub fn predicate_may_hold_fatal(&mut self, obligation: &PredicateObligation<'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<EvaluationResult, OverflowError> {
index 83aebd16e2400889199bec1efd253d0f460806e1..59b743abaf14b05ec29dd51284598e4418601e1b 100644 (file)
@@ -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)
         },
     )
 }