-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Description
rustc 1.3.0-dev (04badd6 2015-07-25)
A macro_rules! syntax error reported at expansion site instead of macro definition:
macro_rules! sum {
($h:expr) => $h;
($h:expr, $($t:expr),*) =>
($h + sum!($($t),*));
}
fn main() {
let i = sum!(2,3,4);
println!("{}", i);
}
Error message is:
<anon>:9:13: 9:24 error: macro rhs must be delimited
<anon>:9 let i = sum!(2,3,4);
^~~~~~~~~~~
Where the actual error is in the sum! definition, where $h is undelimited.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)