-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling ambiguous macro invocation hangs forever #5067
Comments
Reproduced as of 4a5e8c5 Backtrace:
|
Seems non-critical for 0.7. Nominating for milestone 1 (well-defined). |
Accepted for well-defined. we need to write down what is and is not macro-parsable. |
visited for bug triage 2013 june 27. still a problem. It would be good to define whether our goal is to eliminate all such macro definitions, or if it would be acceptable to fail instead at the point of expansion, when the macro expander determines that there is more than one possible parse. (The latter would integrate well with a proper Earley parsing scheme and probably with any reasonable GLR parsing scheme as well.) |
Still a problem, unfortunately. I have no knowledge about this, but what @pnkfelix says sounds impressive. |
Triage: still a problem, no updates. |
triage: still an issue (on nightly). |
Still occurs using this updated code: macro_rules! make_vec(
(a $e1:expr $($(, a $e2:expr)*)*) => ([$e1 $($(, $e2)*)*]);
);
fn main() {
let _ = make_vec!(a 1, a 2, a 3);
} |
This code is enough to trigger the bug: macro_rules! m {
( $()* ) => {}
}
m!(); I guess repetitions should check that their innards can not be not empty. |
Still an issue in 1.12.0-nightly using the minimal repro in the previous comment. |
reject macros with empty repetitions Fixes rust-lang#5067 by checking the lhs of `macro_rules!` for repetitions which could match an empty token tree.
reject macros with empty repetitions Fixes rust-lang#5067 by checking the lhs of `macro_rules!` for repetitions which could match an empty token tree.
…1995 Add `skip_while_next` lint Fixes rust-lang#4036 changelog: Add `skip_while_next` lint
Trying to compile this code containing an ambiguous macro causes the compiler to hang forever and max out memory:
rustc 0.5
host: x86_64-apple-darwin
The text was updated successfully, but these errors were encountered: