Closed
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?