Merge pull request #151 from zicklag/patch-2

[Docs] Add Cargo Expand to Macro Debugging Tips
This commit is contained in:
Carter Anderson 2020-08-12 18:50:03 -07:00 committed by GitHub
commit 090c06c55a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,5 +2,7 @@
## 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.
- Additionally get pager by piping to `less` ( on Unix systems ): `cargo expand --color always | less -R`
- Print output during macro compilation using `eprintln!("hi");`