File tree 1 file changed +9
-2
lines changed
compiler/rustc_trait_selection/src/solve
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -78,15 +78,22 @@ impl<'tcx> InferCtxtEvalExt<'tcx> for InferCtxt<'tcx> {
78
78
) -> Result < ( bool , Certainty ) , NoSolution > {
79
79
let mut search_graph = search_graph:: SearchGraph :: new ( self . tcx ) ;
80
80
81
- let result = EvalCtxt {
81
+ let mut ecx = EvalCtxt {
82
82
search_graph : & mut search_graph,
83
83
infcx : self ,
84
84
// Only relevant when canonicalizing the response.
85
85
max_input_universe : ty:: UniverseIndex :: ROOT ,
86
86
var_values : CanonicalVarValues :: dummy ( ) ,
87
87
nested_goals : NestedGoals :: new ( ) ,
88
+ } ;
89
+ let result = ecx. evaluate_goal ( IsNormalizesToHack :: No , goal) ;
90
+
91
+ if let Ok ( ( _, Certainty :: Yes ) ) = result {
92
+ assert ! (
93
+ ecx. nested_goals. is_empty( ) ,
94
+ "Cannot be certain of query response if unevaluated goals exist"
95
+ ) ;
88
96
}
89
- . evaluate_goal ( IsNormalizesToHack :: No , goal) ;
90
97
91
98
assert ! ( search_graph. is_empty( ) ) ;
92
99
result
You can’t perform that action at this time.
0 commit comments