From b4443b0398debdae312c4a5c48e2093c6769d552 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 11 Jul 2020 20:01:56 +0200 Subject: Bump macro recursion limit in release --- crates/ra_hir_def/src/body.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_def') diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 8c233a717..2fe04db2b 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs @@ -46,6 +46,12 @@ pub(crate) struct Expander { recursion_limit: usize, } +#[cfg(test)] +const EXPANSION_RECURSION_LIMIT: usize = 32; + +#[cfg(not(test))] +const EXPANSION_RECURSION_LIMIT: usize = 128; + impl CfgExpander { pub(crate) fn new( db: &dyn DefDatabase, @@ -93,7 +99,7 @@ impl Expander { macro_call: ast::MacroCall, ) -> Option<(Mark, T)> { self.recursion_limit += 1; - if self.recursion_limit > 32 { + if self.recursion_limit > EXPANSION_RECURSION_LIMIT { mark::hit!(your_stack_belongs_to_me); return None; } @@ -341,7 +347,7 @@ mod tests { fn your_stack_belongs_to_me() { mark::check!(your_stack_belongs_to_me); lower( - r" + " macro_rules! n_nuple { ($e:tt) => (); ($($rest:tt)*) => {{ -- cgit v1.2.3