You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
macro_rules! a {(<$($($d:expr),*$($c:ident),*)*>) => (B<$($d,)*$($c,)*>);}a!(<>);
The text was updated successfully, but these errors were encountered:
Aatch
changed the title
Rustc are draining system memory when compiling with these code.
Rustc is draining system memory when compiling this code.
Apr 27, 2015
Aatch
added
I-crash
Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
labels
Apr 27, 2015
I don't think the root problem is a double-repetition, but rather a repetition of something that can be 0 tokens long. In this case $($d:tt)* can contain 0 tokens, which then cause the memory explosion on the attempt to repeat it. Replacing the inner repetition with $($d:tt)+ prevents this bug, changing the outer repetition to use + doesn't.
See #28085, which I think is a duplicate of this (tl;dr: replacing the matcher with just $()+ or $()* also causes this).
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Play rust link: http://is.gd/DVjBtk
The text was updated successfully, but these errors were encountered: