internal: macro_arg query always returns a TokenTree

This commit is contained in:
Lukas Wirth 2024-02-12 15:26:17 +01:00
parent e2a985e93f
commit 2fa57d90bc
12 changed files with 139 additions and 131 deletions

View file

@ -140,13 +140,11 @@ impl Expander {
// The overflow error should have been reported when it occurred (see the next branch),
// so don't return overflow error here to avoid diagnostics duplication.
cov_mark::hit!(overflow_but_not_me);
return ExpandResult::only_err(ExpandError::RecursionOverflowPoisoned);
return ExpandResult::ok(None);
} else if self.recursion_limit.check(self.recursion_depth as usize + 1).is_err() {
self.recursion_depth = u32::MAX;
cov_mark::hit!(your_stack_belongs_to_me);
return ExpandResult::only_err(ExpandError::other(
"reached recursion limit during macro expansion",
));
return ExpandResult::only_err(ExpandError::RecursionOverflow);
}
let ExpandResult { value, err } = op(self);