We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
local_overflow_limit
1 parent 7659abc commit 7272552Copy full SHA for 7272552
compiler/rustc_trait_selection/src/solve/search_graph/mod.rs
@@ -51,13 +51,9 @@ pub(super) struct SearchGraph<'tcx> {
51
52
impl<'tcx> SearchGraph<'tcx> {
53
pub(super) fn new(tcx: TyCtxt<'tcx>, mode: SolverMode) -> SearchGraph<'tcx> {
54
- let local_overflow_limit = {
55
- let recursion_limit = tcx.recursion_limit().0;
56
- if recursion_limit == 0 { 0 } else { recursion_limit.ilog2() as usize }
57
- };
58
Self {
59
mode,
60
- local_overflow_limit,
+ local_overflow_limit: tcx.recursion_limit().0.checked_ilog2().unwrap_or(0) as usize,
61
stack: Default::default(),
62
provisional_cache: ProvisionalCache::empty(),
63
}
0 commit comments