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