Typed macros
A traditional macro can't natively have arguments with type, they can only
accept a handful of meta types (expr
, ident
, vis
...), with this crate
you can explicitely say the type of the argument you want the macro to take.
Example
use macrox;
macrox!
The main macro is macrox
, it takes an input like macro name(arg1: type1, arg2: type2) { /* Code */ }
, both the macrox
Testing
You can run cargo test
in the root directory, but you'll only see an error (an intended error) because the macro this_should_warn
was asking for a u32
type, and the test tried to use it with a String
.