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,