Further little alert about non-macro generation

This commit is contained in:
Michal 'vorner' Vaner 2020-05-14 16:56:45 +02:00
parent 7c8e842521
commit dcee953c63
No known key found for this signature in database
GPG Key ID: F700D0C019E4C66F

View File

@ -232,12 +232,15 @@ macro.
## Non-macro code generators
When using `quote` in a build.rs or main.rs and writing the output out to a
When using `quote` in a `build.rs` or `main.rs` and writing the output out to a
file, consider having the code generator pass the tokens through [rustfmt]
before writing (either by shelling out to the `rustfmt` binary or by pulling in
the `rustfmt` library as a dependency). This way if an error occurs in the
generated code it is convenient for a human to read and debug.
Obviously, no kind of hygiene or span information is preserved when writing the
output to a file.
[rustfmt]: https://github.com/rust-lang/rustfmt
<br>