-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for -Zunpretty=hir #683
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
🎉 |
This is the first half of #502. Adding support for the AST requires first adding
-Zunpretty=ast
to 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.