/src/test/compile-fail/macro-2.rs

http://github.com/jruderman/rust · Rust · 10 lines · 8 code · 1 blank · 1 comment · 1 complexity · 1f6b661338e77da915361480450644c3 MD5 · raw file

  1. //error-pattern:is an expr, expected an identifier
  2. fn main() {
  3. #macro[[#mylambda[x, body],
  4. {
  5. fn f(x: int) -> int { return body }
  6. f
  7. }]];
  8. assert (mylambda!{y * 1, y * 2}(8) == 16);
  9. }