2019-06-12 10:18:32 -05:00
|
|
|
// check-pass
|
2016-04-12 19:15:37 -05:00
|
|
|
|
|
|
|
macro_rules! foo { () => {
|
|
|
|
let x = 1;
|
|
|
|
macro_rules! bar { () => {x} }
|
|
|
|
let _ = bar!();
|
|
|
|
}}
|
|
|
|
|
2016-09-27 01:38:17 -05:00
|
|
|
macro_rules! m { // test issue #31856
|
2016-04-13 20:20:22 -05:00
|
|
|
($n:ident) => (
|
|
|
|
let a = 1;
|
|
|
|
let $n = a;
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2016-04-14 21:22:34 -05:00
|
|
|
macro_rules! baz {
|
|
|
|
($i:ident) => {
|
|
|
|
let mut $i = 2;
|
|
|
|
$i = $i + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-31 07:08:01 -05:00
|
|
|
fn main() {
|
2016-04-13 20:20:22 -05:00
|
|
|
foo! {};
|
|
|
|
bar! {};
|
2016-04-14 21:22:34 -05:00
|
|
|
|
|
|
|
let mut a = true;
|
|
|
|
baz!(a);
|
2016-04-13 20:20:22 -05:00
|
|
|
}
|