Suppose I write a proc macro that triggers UB when it runs (as in, the part that runs in the compiler at build time, not the generated code). Obviously, I no longer have any guarantees about what code my proc macro will output (which means the call site can turn into arbitrary code), or even if it does output code (it might hang, panic, or otherwise not return).
My question is, how pervasively does the consequences of the UB spread? If my UB proc macro returns some string of tokens (so for this question we're assuming the UB doesn't cause it to hang/panic/etc), is the rest of my program's compilation safe from any negative effects of the UB? Or does the UB spread into the rest of the compiler and enable other code sections to miscompile?
The nature of UB is that anything can happen - your UB could damage critical data structures in the compiler, resulting in the compiler doing anything, including miscompiling code the procmacro was not supposed to touch.
And the "joy" of UB is that you can't demonstrate that this doesn't happen, because the exact behaviour of your procmacro can change every time it's compiled - indeed, one of the symptoms I look for when trying to judge if code contains UB is whether a seemingly insignificant change (like adding a debug print) "fixes" the bug.