-
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
This code
#![crate_type = "lib"]
macro_rules! expensive_static {
($name: ident : $T: ty = $e : expr) =>
(pub static $name : Vec<$T> = vec![$e])
}
expensive_static!(Y : &'static str = "hello");
produces the following error:
error: expected one of `.`, `;`, `?`, or an operator, found `<eof>`
--> src/lib.rs:5:43
|
5 | (pub static $name : Vec<$T> = vec![$e])
| ^^^^ expected one of `.`, `;`, `?`, or an operator here
So I thought something was wrong with the arguments to the vec!
macro. But really the problem is that I forgot the ;
after that macro. Thankfully someone on IRC knew, I would never have figured that out...
Can the error message be improved?
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, ..)