Closed
Description
This macro will never work:
macro_rules! foo {
($name:ident; $method:item) => (
struct $name();
impl $name {
$method
}
)
}
Instead of reinterpreting $method
as an impl item, the macro expander says it was expecting const
, crate
, default
, extern
, fn
, pub
, type
, unsafe
, or }
.
Moreover :item
isn't good enough for parsing impl items because it doesn't have a special case for self
arguments.
Is the solution to create a new :implitem
or to make :item
more flexible in parsing and expansion?