We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e4c6c70 + ec41561 commit cd83dedCopy full SHA for cd83ded
crates/hir_def/src/body.rs
@@ -103,8 +103,7 @@ impl Expander {
103
local_scope: Option<&ItemScope>,
104
macro_call: ast::MacroCall,
105
) -> ExpandResult<Option<(Mark, T)>> {
106
- self.recursion_limit += 1;
107
- if self.recursion_limit > EXPANSION_RECURSION_LIMIT {
+ if self.recursion_limit + 1 > EXPANSION_RECURSION_LIMIT {
108
mark::hit!(your_stack_belongs_to_me);
109
return ExpandResult::str_err("reached recursion limit during macro expansion".into());
110
}
@@ -165,6 +164,7 @@ impl Expander {
165
164
166
log::debug!("macro expansion {:#?}", node.syntax());
167
+ self.recursion_limit += 1;
168
let mark = Mark {
169
file_id: self.current_file_id,
170
ast_id_map: mem::take(&mut self.ast_id_map),
0 commit comments