handle edge-case of a recursion limit of 0
This commit is contained in:
parent
bb90f81070
commit
7762ac7bb5
1 changed files with 5 additions and 1 deletions
|
@ -51,9 +51,13 @@ pub(super) struct SearchGraph<'tcx> {
|
||||||
|
|
||||||
impl<'tcx> SearchGraph<'tcx> {
|
impl<'tcx> SearchGraph<'tcx> {
|
||||||
pub(super) fn new(tcx: TyCtxt<'tcx>, mode: SolverMode) -> SearchGraph<'tcx> {
|
pub(super) fn new(tcx: TyCtxt<'tcx>, mode: SolverMode) -> SearchGraph<'tcx> {
|
||||||
|
let local_overflow_limit = {
|
||||||
|
let recursion_limit = tcx.recursion_limit().0;
|
||||||
|
if recursion_limit == 0 { 0 } else { recursion_limit.ilog2() as usize }
|
||||||
|
};
|
||||||
Self {
|
Self {
|
||||||
mode,
|
mode,
|
||||||
local_overflow_limit: tcx.recursion_limit().0.ilog2() as usize,
|
local_overflow_limit,
|
||||||
stack: Default::default(),
|
stack: Default::default(),
|
||||||
provisional_cache: ProvisionalCache::empty(),
|
provisional_cache: ProvisionalCache::empty(),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue