-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Teach rustc --emit=mir #39891
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Teach rustc --emit=mir #39891
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
cc @rust-lang/compiler |
So this seems to fall under a broad category of options that we currently confine to I sort of suspect that such a family of options should have their own header (rather like |
This seems like a reasonable categorization.
Absolutely.
This makes sense to me
I suspect I fall into the target group of that "primarily" 😇 . My personal stake is that I'd like to have a stable and unified way of accessing the final MIR, ASM, and LLVM-IR for the playground. In that context, all three of these are debugging/educational, often for the purposes of "how does that look when optimized?". |
We could probably find a better name for |
@eddyb seems reasonable to me. I'm also not opposed to using |
So I was looking into
Is that then the right option? Does it matter if we mix "tool"-targeting things from "human"-targeting things under one option? It feels like it will encourage misuse, but perhaps not. |
FWIW |
@alexcrichton I definitely agree |
Or maybe those things aren't especially stable either? |
I'd personally be ok with a giant header comment saying "THIS OUTPUT IS NOT STABLE IT'S JUST MEANT FOR DEBUGGING, IT WILL CHANGE WITHOUT NOTIFICATION" or something like that. |
@alexcrichton where would such a comment go? Would it apply to all the things that Right now the full list shows up in |
Oh sorry I misread what you preferred. I assumed that you preferred If you prefer |
@alexcrichton oh, like, put it in the output itself? That's...kind of a good idea. =) |
Just add something like to the front:
Regarding |
@nikomatsakis precisely yeah (that's what I was thinking) |
fb8f280
to
476a1b9
Compare
@alexcrichton I actually really like that =) |
@rfcbot fcp merge I propose we adopt @alexcrichton's suggestion here, and support |
Team member @nikomatsakis has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Because I found it equally amusing and informative, I added @nikomatsakis suggested phrasing verbatim. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
☔ The latest upstream changes (presumably #39628) made this pull request unmergeable. Please resolve the merge conflicts. |
Nothing scarier than your little ol' PR getting a merge conflict from a hulking |
To prevent tools from using this you could put spaces/dots/underscores at random places. |
@bjorn3 Any half-decent lexer can remove extra spaces, and if it impedes a lexer, it also does humans. |
@nikomatsakis thank you for the heads up. The build is green again. |
Mm I'm going to r+ even though the FCP has not yet expired. I think we've had enough time here. |
@bors r+ |
📌 Commit 4ddedf7 has been approved by |
Teach rustc --emit=mir I'm opening this PR to discuss: 1. Is this a good idea? 1. Is this a good implementation? I'm sure people will have opinions on both points! This spawned from rust-lang#31847 (comment), so I figured a prototype implementation could help provide a seed to talk about.
…n doc. This is added because 'rustc' can now generate MIR (referencing to "Teach rustc --emit=mir rust-lang#39891").
add 'mir' to rustc help menu and man doc add 'mir' to '--emit' flag list for 'rustc'. This is added because 'rustc' can now generate MIR (referencing to "Teach rustc --emit=mir rust-lang#39891").
I'm opening this PR to discuss:
I'm sure people will have opinions on both points!
This spawned from #31847 (comment), so I figured a prototype implementation could help provide a seed to talk about.