Closed
Description
When you write a macro that tries to call a method on the type...
macro_rules! call {
($t:ty) => {
$t::foo()
}
}
...and try to call it...
call!(Foo);
...you get an error that doesn't make any sense:
error: expected expression, found `Foo`
--> expr.rs:18:45
|
18 | match {macro_rules! call { ($t:ty) => { $t::foo() } } call!(Foo);} {
| ^^ ----------- in this macro invocation
| |
| expected expression
The syntax that works is <$t>::foo()
, but there's no way to discover this, so the error message should suggest it.
cc @eddyb