rust/tests/ui/macros/macro-2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
233 B
Rust
Raw Normal View History

// 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);
}