0

Does rust replace all occurrences of macros with some code before compilation or during compilation like how it happens with c/c++ ?

Another aspect of this is how to understand what compiler is doing. Is there any way to dissemble the code and see what’s happening during compilation of rust program.

Galactus
  • 87
  • 1
  • 8
  • 1
    Your second question is answered here: [How do I see the expanded macro code that's causing my compile error?](https://stackoverflow.com/questions/28580386/how-do-i-see-the-expanded-macro-code-thats-causing-my-compile-error) – kmdreko Mar 01 '21 at 17:01
  • I may be wrong from the link you have given it answers my first question too. I assume that macro gets expanded everywhere it’s used – Galactus Mar 01 '21 at 17:15
  • Macros are expanded almost everywhere there used- macro invocations are expanded from the outside in, and macros are capable of deleting input, so it is possible that a macro invocation inside another invocation is never expanded. – Aiden4 Mar 01 '21 at 17:34

0 Answers0