about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAravind Gollakota <aravindprasant@gmail.com>2018-04-08 02:04:46 -0500
committerAravind Gollakota <aravindprasant@gmail.com>2018-04-26 20:28:30 -0500
commit3dd26b8a3ef9e10dd92f1c958e97493dfbd8788d (patch)
treed16af4ebcb1af340aa1651eaf570faf308b4322f /src
parentbc16b8e92a8e7dcf14b9c94b9248b5ad6957b1f4 (diff)
downloadrust-3dd26b8a3ef9e10dd92f1c958e97493dfbd8788d.tar.gz
rust-3dd26b8a3ef9e10dd92f1c958e97493dfbd8788d.zip
Simplify trait selector's evaluation API slightly
Diffstat (limited to 'src')
-rw-r--r--src/librustc/traits/coherence.rs4
-rw-r--r--src/librustc/traits/select.rs24
2 files changed, 6 insertions, 22 deletions
diff --git a/src/librustc/traits/coherence.rs b/src/librustc/traits/coherence.rs
index 2e271669ed7..5a626e7b82c 100644
--- a/src/librustc/traits/coherence.rs
+++ b/src/librustc/traits/coherence.rs
@@ -154,8 +154,8 @@ fn overlap<'cx, 'gcx, 'tcx>(selcx: &mut SelectionContext<'cx, 'gcx, 'tcx>,
                                            recursion_depth: 0,
                                            predicate: p })
                      .chain(obligations)
-                     .find(|o| !selcx.evaluate_obligation(o));
-    // FIXME: the call to `selcx.evaluate_obligation` above should be ported
+                     .find(|o| !selcx.predicate_may_hold_fatal(o));
+    // FIXME: the call to `selcx.predicate_may_hold_fatal` above should be ported
     // to the canonical trait query form, `infcx.predicate_may_hold`, once
     // the new system supports intercrate mode (which coherence needs).
 
diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs
index 3dedfcd357e..aae21e62051 100644
--- a/src/librustc/traits/select.rs
+++ b/src/librustc/traits/select.rs
@@ -575,11 +575,11 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
     // we can be sure it does not.
 
     /// Evaluates whether the obligation `obligation` can be satisfied (by any means).
-    pub fn evaluate_obligation(&mut self,
-                               obligation: &PredicateObligation<'tcx>)
-                               -> bool
+    pub fn predicate_may_hold_fatal(&mut self,
+                                    obligation: &PredicateObligation<'tcx>)
+                                    -> bool
     {
-        debug!("evaluate_obligation({:?})",
+        debug!("predicate_may_hold_fatal({:?})",
                obligation);
 
         match self.evaluate_obligation_recursively(obligation) {
@@ -588,22 +588,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
         }
     }
 
-    /// Evaluates whether the obligation `obligation` can be satisfied,
-    /// and returns `false` if not certain. However, this is not entirely
-    /// accurate if inference variables are involved.
-    pub fn evaluate_obligation_conservatively(&mut self,
-                                              obligation: &PredicateObligation<'tcx>)
-                                              -> bool
-    {
-        debug!("evaluate_obligation_conservatively({:?})",
-               obligation);
-
-        match self.evaluate_obligation_recursively(obligation) {
-            Ok(result) => result == EvaluatedToOk,
-            Err(OverflowError(o)) => self.infcx().report_overflow_error(&o, true)
-        }
-    }
-
     /// Evaluates whether the obligation `obligation` can be satisfied and returns
     /// an `EvaluationResult`.
     pub fn evaluate_obligation_recursively(&mut self,