Skip to content

Commit c046831

Browse files
committed
add ensure_sufficient_stack to the new solver
1 parent ae3c353 commit c046831

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

compiler/rustc_trait_selection/src/solve/eval_ctxt.rs

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use rustc_data_structures::stack::ensure_sufficient_stack;
12
use rustc_hir::def_id::{DefId, LocalDefId};
23
use rustc_infer::infer::at::ToTrace;
34
use rustc_infer::infer::canonical::CanonicalVarValues;
@@ -305,24 +306,26 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
305306
// Deal with overflow, caching, and coinduction.
306307
//
307308
// The actual solver logic happens in `ecx.compute_goal`.
308-
search_graph.with_new_goal(
309-
tcx,
310-
canonical_input,
311-
goal_evaluation,
312-
|search_graph, goal_evaluation| {
313-
EvalCtxt::enter_canonical(
314-
tcx,
315-
search_graph,
316-
canonical_input,
317-
goal_evaluation,
318-
|ecx, goal| {
319-
let result = ecx.compute_goal(goal);
320-
ecx.inspect.query_result(result);
321-
result
322-
},
323-
)
324-
},
325-
)
309+
ensure_sufficient_stack(|| {
310+
search_graph.with_new_goal(
311+
tcx,
312+
canonical_input,
313+
goal_evaluation,
314+
|search_graph, goal_evaluation| {
315+
EvalCtxt::enter_canonical(
316+
tcx,
317+
search_graph,
318+
canonical_input,
319+
goal_evaluation,
320+
|ecx, goal| {
321+
let result = ecx.compute_goal(goal);
322+
ecx.inspect.query_result(result);
323+
result
324+
},
325+
)
326+
},
327+
)
328+
})
326329
}
327330

328331
/// Recursively evaluates `goal`, returning whether any inference vars have

0 commit comments

Comments
 (0)