-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I know what is my mistake, but I think there is a bug in Rust!
Edit: We just need a better help from the compiler to easily spot out mistake like this.
Edit: the problem seems just involve only the first rule. So the new minimal buggy code is:
macro_rules! there_is_a_bug {
( $id:ident: $($tail:tt)* ) => {
there_is_a_bug! { $($tail:tt)* } // I dit it wrong here `:tt`
};
}
fn main() {
there_is_a_bug! { something: more {} }
}
cargo build
will run forever! (well, I just wait for it for about ten minutes!)
rustup show
stable-x86_64-unknown-linux-gnu (default)
rustc 1.27.0 (3eda71b00 2018-06-19)
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.