File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
compiler/rustc_trait_selection/src/solve Expand file tree Collapse file tree 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> {
7878 ) -> Result < ( bool , Certainty ) , NoSolution > {
7979 let mut search_graph = search_graph:: SearchGraph :: new ( self . tcx ) ;
8080
81- let result = EvalCtxt {
81+ let mut ecx = EvalCtxt {
8282 search_graph : & mut search_graph,
8383 infcx : self ,
8484 // Only relevant when canonicalizing the response.
8585 max_input_universe : ty:: UniverseIndex :: ROOT ,
8686 var_values : CanonicalVarValues :: dummy ( ) ,
8787 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+ ) ;
8896 }
89- . evaluate_goal ( IsNormalizesToHack :: No , goal) ;
9097
9198 assert ! ( search_graph. is_empty( ) ) ;
9299 result
You can’t perform that action at this time.
0 commit comments