@@ -62,8 +62,9 @@ pub struct EvalCtxt<'a, 'tcx> {
62
62
//
63
63
// If so, then it can no longer be used to make a canonical query response,
64
64
// since subsequent calls to `try_evaluate_added_goals` have possibly dropped
65
- // ambiguous goals. Instead, use a probe.
66
- tainted : bool ,
65
+ // ambiguous goals. Instead, a probe needs to be introduced somewhere in the
66
+ // evaluation code.
67
+ tainted : Result < ( ) , NoSolution > ,
67
68
}
68
69
69
70
#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
@@ -128,7 +129,7 @@ impl<'tcx> InferCtxtEvalExt<'tcx> for InferCtxt<'tcx> {
128
129
max_input_universe : ty:: UniverseIndex :: ROOT ,
129
130
var_values : CanonicalVarValues :: dummy ( ) ,
130
131
nested_goals : NestedGoals :: new ( ) ,
131
- tainted : false ,
132
+ tainted : Ok ( ( ) ) ,
132
133
} ;
133
134
let result = ecx. evaluate_goal ( IsNormalizesToHack :: No , goal) ;
134
135
@@ -180,7 +181,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
180
181
max_input_universe : canonical_goal. max_universe ,
181
182
search_graph,
182
183
nested_goals : NestedGoals :: new ( ) ,
183
- tainted : false ,
184
+ tainted : Ok ( ( ) ) ,
184
185
} ;
185
186
ecx. compute_goal ( goal)
186
187
} )
@@ -401,7 +402,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
401
402
) ;
402
403
403
404
if response. is_err ( ) {
404
- self . tainted = true ;
405
+ self . tainted = Err ( NoSolution ) ;
405
406
}
406
407
407
408
self . nested_goals = goals;
0 commit comments