Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #![feature(decl_macro)]
  2.  
  3. macro foo() {
  4. // This identifier has a fresh hygiene scope local to
  5. // *each invocation* of `foo!`.
  6. // vvv
  7. macro bar() {}
  8. bar!();
  9. }
  10.  
  11. // No collisions between these two definitions and
  12. // invocations of `bar!`.
  13. foo!();
  14. foo!();
  15.  
  16. // Uncomment to see a 'cannot find macro `bar!` in this scope' error.
  17. //bar!();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement