]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #94655 - JakobDegen:mir-phase-docs, r=oli-obk
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Fri, 25 Mar 2022 00:34:29 +0000 (01:34 +0100)
committerGitHub <noreply@github.com>
Fri, 25 Mar 2022 00:34:29 +0000 (01:34 +0100)
Clarify which kinds of MIR are allowed during which phases.

This enhances documentation with these details and extends the validator to check these requirements more thoroughly. Most of these conditions were already being checked.

There was also some disagreement between the `MirPhase` docs and validator as to what it meant for the `body.phase` field to have a certain value. This PR resolves those disagreements in favor of the `MirPhase` docs (which is what the pass manager implemented), adjusting the validator accordingly. The result is now that the `DropLowering` phase begins with the end of the elaborate drops pass, and lasts until the beginning of the generator lowring pass. This doesn't feel entirely natural to me, but as long as it's documented accurately it should be ok.

r? rust-lang/mir-opt

1  2 
compiler/rustc_mir_transform/src/lib.rs