How to Debug Proc Macro Compilation Errors

Use RUSTFLAGS="-Z macro-backtrace" to view expanded proc macro code and debug compilation errors.

Enable verbose macro expansion to see the generated code and pinpoint syntax errors in your proc macro logic.

RUSTFLAGS="-Z macro-backtrace" cargo build

This flag forces the compiler to print the expanded macro output and includes a backtrace showing exactly where the macro expansion failed.