Guest User

Untitled

a guest
Nov 15th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. fn main() {
  2. foo!("hello"); // no import necessary at the root
  3. bar::baz();
  4. }
  5.  
  6. mod bar {
  7. use crate::foo; // this import is required
  8. pub fn baz() {
  9. foo!("goodbye");
  10. }
  11. }
  12.  
  13. mod test {
  14. #[macro_export]
  15. macro_rules! foo {
  16. ($fmt:expr) => (print!(concat!($fmt, "\n")));
  17. }
  18. }
Add Comment
Please, Sign In to add comment