Skip to content

Commit 0e1e964

Browse files
committed
handle edge-case of a recursion limit of 0
1 parent bb90f81 commit 0e1e964

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_trait_selection/src/solve/search_graph

1 file changed

+1
-1
lines changed

compiler/rustc_trait_selection/src/solve/search_graph/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl<'tcx> SearchGraph<'tcx> {
5353
pub(super) fn new(tcx: TyCtxt<'tcx>, mode: SolverMode) -> SearchGraph<'tcx> {
5454
Self {
5555
mode,
56-
local_overflow_limit: tcx.recursion_limit().0.ilog2() as usize,
56+
local_overflow_limit: tcx.recursion_limit().0.checked_ilog2().unwrap_or(0) as usize,
5757
stack: Default::default(),
5858
provisional_cache: ProvisionalCache::empty(),
5959
}

0 commit comments

Comments
 (0)