Add Cargo Expand to Macro Debugging Tips

This commit is contained in:
Zicklag 2020-08-12 19:18:26 -05:00 committed by GitHub
parent d488d4e308
commit 4977837fad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,5 +2,6 @@
## Macro Debugging
* Print the final output of a macro using ```cargo rustc --profile=check -- -Zunstable-options --pretty=expanded```
* Print output during macro compilation using ```eprintln!("hi");```
- Print the final output of a macro using `cargo rustc --profile=check -- -Zunstable-options --pretty=expanded`
- Alternatively you could install and use [cargo expand](https://github.com/dtolnay/cargo-expand) which adds syntax highlighting to the terminal output.
- Print output during macro compilation using `eprintln!("hi");`