diff options
Diffstat (limited to 'tests/ui/macros/macro-2.rs')
-rw-r--r-- | tests/ui/macros/macro-2.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/macros/macro-2.rs b/tests/ui/macros/macro-2.rs new file mode 100644 index 000000000..a315981b6 --- /dev/null +++ b/tests/ui/macros/macro-2.rs @@ -0,0 +1,12 @@ +// run-pass +pub fn main() { + + macro_rules! mylambda_tt { + ($x:ident, $body:expr) => ({ + fn f($x: isize) -> isize { return $body; } + f + }) + } + + assert_eq!(mylambda_tt!(y, y * 2)(8), 16); +} |