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
Improve documentation of MIR queries & passes #1434
base: master
Are you sure you want to change the base?
Conversation
accidently -> accidentally Co-authored-by: Tshepang Mbambo <tshepang@gmail.com>
with rust-lang/rust#99102 now accepted, does this need to change |
Yes, the doc in this PR need to change to reflect the recent changes in rust-lang/rust#99102. But we could wait a minute until it gets more stable and complete since the MIR phases and semantics there, I think, are under overhaul. |
rust-lang/rust#99102 has been merged :) |
the final, optimized MIR. For foreign def-ids, we simply read the MIR | ||
If you would like to get the MIR: | ||
|
||
- for a function - you can use the `optimized_mir(def_id)` query; |
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.
there's also the MIR that const eval sees for a function: mir_for_ctfe(def_id)
cc @JakobDegen |
I'm not sure what's the current status of this PR, but would be great if we merge something about it, thoughts?. |
This PR improve the documentation of MIR queries and passes.
Below is the summary of changes:
mir_validated
mir_promoted
andmir_drops_elaborated_and_const_checked
NoLandingPads
pass example withCleanupNonCodegenStatements
mdbook-mermaid
in the build instructionsFIXME:
ty::queries::foo::force(...)
still appear in rustc?Since rust-lang/rust#99102 may significantly change the MIR queries (and thus its doc), we can wait for its result or send follow-up PRs. This is mostly documenting the code in
rustc_mir_transform
, so maybe cc @rust-lang/wg-mir-opt.