Rollup merge of #86484 - fee1-dead:builtin-macro-recursion, r=petrochenkov
Do not set depth to 0 in fully_expand_fragment Fixes #84632.
This commit is contained in:
commit
e5ecded392
3 changed files with 31 additions and 1 deletions
|
|
@ -0,0 +1,16 @@
|
|||
// Regression test for #84632: Recursion limit is ignored
|
||||
// for builtin macros that eagerly expands.
|
||||
|
||||
#![recursion_limit = "15"]
|
||||
macro_rules! a {
|
||||
() => ("");
|
||||
(A) => (concat!("", a!()));
|
||||
(A, $($A:ident),*) => (concat!("", a!($($A),*)))
|
||||
//~^ ERROR recursion limit reached
|
||||
//~| HELP consider adding
|
||||
}
|
||||
|
||||
fn main() {
|
||||
a!(A, A, A, A, A);
|
||||
a!(A, A, A, A, A, A, A, A, A, A, A);
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
error: recursion limit reached while expanding `concat!`
|
||||
--> $DIR/issue-84632-eager-expansion-recursion-limit.rs:8:28
|
||||
|
|
||||
LL | (A, $($A:ident),*) => (concat!("", a!($($A),*)))
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
...
|
||||
LL | a!(A, A, A, A, A, A, A, A, A, A, A);
|
||||
| ------------------------------------ in this macro invocation
|
||||
|
|
||||
= help: consider adding a `#![recursion_limit="30"]` attribute to your crate (`issue_84632_eager_expansion_recursion_limit`)
|
||||
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue