diff options
Diffstat (limited to 'tests/ui/did_you_mean/recursion_limit_macro.rs')
-rw-r--r-- | tests/ui/did_you_mean/recursion_limit_macro.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/did_you_mean/recursion_limit_macro.rs b/tests/ui/did_you_mean/recursion_limit_macro.rs new file mode 100644 index 000000000..a68a5ece7 --- /dev/null +++ b/tests/ui/did_you_mean/recursion_limit_macro.rs @@ -0,0 +1,15 @@ +// Test that the recursion limit can be changed and that the compiler +// suggests a fix. In this case, we have a recursing macro that will +// overflow if the number of arguments surpasses the recursion limit. + +#![allow(dead_code)] +#![recursion_limit="10"] + +macro_rules! recurse { + () => { }; + ($t:tt $($tail:tt)*) => { recurse!($($tail)*) }; //~ ERROR recursion limit +} + +fn main() { + recurse!(0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9); +} |