@@ -62,8 +62,9 @@ pub struct EvalCtxt<'a, 'tcx> {
6262 //
6363 // If so, then it can no longer be used to make a canonical query response,
6464 // 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 > ,
6768}
6869
6970#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
@@ -128,7 +129,7 @@ impl<'tcx> InferCtxtEvalExt<'tcx> for InferCtxt<'tcx> {
128129 max_input_universe : ty:: UniverseIndex :: ROOT ,
129130 var_values : CanonicalVarValues :: dummy ( ) ,
130131 nested_goals : NestedGoals :: new ( ) ,
131- tainted : false ,
132+ tainted : Ok ( ( ) ) ,
132133 } ;
133134 let result = ecx. evaluate_goal ( IsNormalizesToHack :: No , goal) ;
134135
@@ -180,7 +181,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
180181 max_input_universe : canonical_goal. max_universe ,
181182 search_graph,
182183 nested_goals : NestedGoals :: new ( ) ,
183- tainted : false ,
184+ tainted : Ok ( ( ) ) ,
184185 } ;
185186 ecx. compute_goal ( goal)
186187 } )
@@ -401,7 +402,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
401402 ) ;
402403
403404 if response. is_err ( ) {
404- self . tainted = true ;
405+ self . tainted = Err ( NoSolution ) ;
405406 }
406407
407408 self . nested_goals = goals;
0 commit comments