Add macro_rules tests

This commit is contained in:
Ingvar Stepanyan 2018-01-24 19:09:49 +00:00
parent 5d973d2e8c
commit c750442e04
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,16 @@
macro_rules! m {
($expr :expr, $func : ident) => {
{
let x = $expr;
$func (
x
)
}
};
() => { };
( $item:ident ) => {
mod macro_item { struct $item ; }
};
}

View file

@ -0,0 +1,17 @@
macro_rules! m {
($expr: expr, $func: ident) => {
{
let x = $expr;
$func(x)
}
};
() => {
};
($item: ident) => {
mod macro_item {
struct $item;
}
};
}