Skip to content

Commit 611954e

Browse files
committed
WIP patch new user of evaluate_obligation
1 parent 0bbf728 commit 611954e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/librustc/traits/error_reporting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
871871
obligation.param_env,
872872
new_trait_ref.to_predicate());
873873

874-
if selcx.evaluate_obligation(&new_obligation) {
874+
if selcx.evaluate_obligation(&new_obligation).must_apply() {
875875
let sp = self.tcx.sess.codemap()
876876
.span_take_while(span, |c| c.is_whitespace() || *c == '&');
877877

src/librustc/traits/select.rs

+11
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,17 @@ impl EvaluationResult {
394394
}
395395
}
396396

397+
pub fn must_apply(self) -> bool {
398+
match self {
399+
EvaluatedToOk => true,
400+
401+
EvaluatedToAmbig |
402+
EvaluatedToUnknown |
403+
EvaluatedToErr |
404+
EvaluatedToRecur => false
405+
}
406+
}
407+
397408
fn is_stack_dependent(self) -> bool {
398409
match self {
399410
EvaluatedToUnknown |

0 commit comments

Comments
 (0)