Retry pred_known_to_hold_modulo_regions with fulfillment if ambiguous
This commit is contained in:
parent
276b75a843
commit
118afdf071
1 changed files with 5 additions and 3 deletions
|
@ -155,10 +155,12 @@ fn pred_known_to_hold_modulo_regions<'tcx>(
|
||||||
predicate: pred.to_predicate(infcx.tcx),
|
predicate: pred.to_predicate(infcx.tcx),
|
||||||
};
|
};
|
||||||
|
|
||||||
let result = infcx.predicate_must_hold_modulo_regions(&obligation);
|
let result = infcx.evaluate_obligation_no_overflow(&obligation);
|
||||||
debug!(?result);
|
debug!(?result);
|
||||||
|
|
||||||
if result && has_non_region_infer {
|
if result.must_apply_modulo_regions() && !has_non_region_infer {
|
||||||
|
true
|
||||||
|
} else if result.may_apply() {
|
||||||
// Because of inference "guessing", selection can sometimes claim
|
// Because of inference "guessing", selection can sometimes claim
|
||||||
// to succeed while the success requires a guess. To ensure
|
// to succeed while the success requires a guess. To ensure
|
||||||
// this function's result remains infallible, we must confirm
|
// this function's result remains infallible, we must confirm
|
||||||
|
@ -179,7 +181,7 @@ fn pred_known_to_hold_modulo_regions<'tcx>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
result
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue