rename evaluate_obligation_recursively
It does not, in fact, execute in a recursive context.
This commit is contained in:
parent
8e948df707
commit
db1dfb2f36
3 changed files with 7 additions and 6 deletions
|
@ -64,7 +64,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
|
||||||
Err(OverflowError) => {
|
Err(OverflowError) => {
|
||||||
let mut selcx =
|
let mut selcx =
|
||||||
SelectionContext::with_query_mode(&self, TraitQueryMode::Standard);
|
SelectionContext::with_query_mode(&self, TraitQueryMode::Standard);
|
||||||
selcx.evaluate_obligation_recursively(obligation)
|
selcx.evaluate_root_obligation(obligation)
|
||||||
.unwrap_or_else(|r| {
|
.unwrap_or_else(|r| {
|
||||||
span_bug!(
|
span_bug!(
|
||||||
obligation.cause.span,
|
obligation.cause.span,
|
||||||
|
|
|
@ -649,14 +649,15 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
|
||||||
// where we do not expect overflow to be propagated.
|
// where we do not expect overflow to be propagated.
|
||||||
assert!(self.query_mode == TraitQueryMode::Standard);
|
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")
|
.expect("Overflow should be caught earlier in standard query mode")
|
||||||
.may_apply()
|
.may_apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Evaluates whether the obligation `obligation` can be satisfied and returns
|
/// Evaluates whether the obligation `obligation` can be satisfied
|
||||||
/// an `EvaluationResult`.
|
/// and returns an `EvaluationResult`. This is meant for the
|
||||||
pub fn evaluate_obligation_recursively(
|
/// *initial* call.
|
||||||
|
pub fn evaluate_root_obligation(
|
||||||
&mut self,
|
&mut self,
|
||||||
obligation: &PredicateObligation<'tcx>,
|
obligation: &PredicateObligation<'tcx>,
|
||||||
) -> Result<EvaluationResult, OverflowError> {
|
) -> Result<EvaluationResult, OverflowError> {
|
||||||
|
|
|
@ -29,7 +29,7 @@ fn evaluate_obligation<'tcx>(
|
||||||
let mut selcx = SelectionContext::with_query_mode(&infcx, TraitQueryMode::Canonical);
|
let mut selcx = SelectionContext::with_query_mode(&infcx, TraitQueryMode::Canonical);
|
||||||
let obligation = Obligation::new(ObligationCause::dummy(), param_env, predicate);
|
let obligation = Obligation::new(ObligationCause::dummy(), param_env, predicate);
|
||||||
|
|
||||||
selcx.evaluate_obligation_recursively(&obligation)
|
selcx.evaluate_root_obligation(&obligation)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue