Add support for -Zunpretty=hir#683
Conversation
shepmaster
left a comment
There was a problem hiding this comment.
I want to run rustfmt on the generated code, but I'm not sure how to do that
You won't be able to; not the way you are trying to, at least. Rustfmt is in a completely separate container (there are 6: stable, beta, nightly, miri, clippy, rustfmt). This allows updating the compiler when miri/clippy/rustfmt are broken.
The same general idea is wanted for expanding macros, so any solution may want to attempt to encompass that, but I expect that the easiest way is to make a second request from the frontend.
Hmm, maybe I could do it by feeding the input to rustfmt on stdin instead of trying to use the same files between containers? I don't think the |
|
FWIW, I think this would be useful to land as is, and I can try to add rustfmt in a follow-up PR. |
|
@shepmaster this is ready for re-review. |
97156b5 to
dbab7f9
Compare
Co-authored-by: Camelid <camelidcamel@gmail.com>
|
🎉 |
This is the first half of #502. Adding support for the AST requires first adding
-Zunpretty=astto the rust compiler (rust-lang/rust#82304).I want to run rustfmt on the generated code, but I'm not sure how to do that.. This is what I tried so far:
But it didn't actually format the code, I'm not sure what's going wrong. AFAIK rustfmt formats files in places, not to stdout.