Open
Description
fn main() {
macro_rules! a {
($e:expr) => { $e; }
}
a!(true)
}
Error: Expected ()
, found bool
But:
fn main() {
macro_rules! a {
($e:expr) => { $e; }
}
a!(true); // <-- semicolon
}
does not warn that the ;
is ignored.
So either
- there should be a warning that the
;
has no effect in the macro, or - the
;
inside the macro should turn the expression into()
.