fix: relax default limit of set_recursion_limit

This commit is contained in:
Shunsuke Shibayama 2024-12-31 13:46:52 +09:00
parent e417e56d91
commit f41264534e
3 changed files with 5 additions and 4 deletions

View file

@ -627,6 +627,9 @@ impl RecursionCounter {
#[macro_export] #[macro_export]
macro_rules! set_recursion_limit { macro_rules! set_recursion_limit {
(panic, $msg:expr) => {
set_recursion_limit!(panic, $msg, 256);
};
(panic, $msg:expr, $limit:expr) => { (panic, $msg:expr, $limit:expr) => {
use std::sync::atomic::AtomicU32; use std::sync::atomic::AtomicU32;

View file

@ -361,8 +361,7 @@ impl Context {
pub(crate) fn structural_supertype_of(&self, lhs: &Type, rhs: &Type) -> bool { pub(crate) fn structural_supertype_of(&self, lhs: &Type, rhs: &Type) -> bool {
set_recursion_limit!( set_recursion_limit!(
panic, panic,
"recursion limit exceed: structural_supertype_of({lhs}, {rhs})", "recursion limit exceed: structural_supertype_of({lhs}, {rhs})"
128
); );
match (lhs, rhs) { match (lhs, rhs) {
// Proc :> Func if params are compatible // Proc :> Func if params are compatible

View file

@ -1054,8 +1054,7 @@ impl<L: Locational> Unifier<'_, '_, '_, L> {
log!(info "trying {}sub_unify:\nmaybe_sub: {maybe_sub}\nmaybe_super: {maybe_super}", self.undoable.map_or("", |_| "undoable_")); log!(info "trying {}sub_unify:\nmaybe_sub: {maybe_sub}\nmaybe_super: {maybe_super}", self.undoable.map_or("", |_| "undoable_"));
set_recursion_limit!( set_recursion_limit!(
panic, panic,
"recursion limit exceed: sub_unify({maybe_sub}, {maybe_super})", "recursion limit exceed: sub_unify({maybe_sub}, {maybe_super})"
128
); );
// In this case, there is no new information to be gained // In this case, there is no new information to be gained
if maybe_sub == &Type::Never if maybe_sub == &Type::Never