Closed
Description
oom in two lines
macro_rules! oom { ( $($( ),*)* ) => { } }
oom!( );
=> fatal out-of-memory (warning: DON'T try to compile this without sufficient precautions - my computer runs out of RAM in 2 seconds with 16GB RAM installed). It doesn't matter what inside or outside of the brackets .. $($( .. ),*)* ..
.
Tested on LINUX, reproducible with stable-1.5, beta-1.6 and nightly.
This modified version is caught by the compiler and safe
macro_rules! no_oom { ( $($( ),*);* ) => { } }
no_oom!( );
src/main.rs:5:1: 5:10 error: ambiguity: multiple successful parses
src/main.rs:5 no_oom!( );
^~~~~~~~~
It would be nice if the compiler could check for anything that might oom like this. I think the safe version gives a hint at what is going wrong with the first version.
Metadata
Metadata
Assignees
Labels
No labels