-
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.
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()
.
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.