Repository navigation
replace TypingEnv::post_analysis() with mir::Body::typing_env() - #164077
adwinwhite wants to merge 1 commit into
Conversation
This comment has been minimized.
This comment has been minimized.
2d08b00 to
0b642e2
Compare
This comment has been minimized.
This comment has been minimized.
0b642e2 to
53c2b35
Compare
| match self.phase { | ||
| MirPhase::Built | MirPhase::Analysis(_) => TypingEnv::new( | ||
| match self.typing_mode { | ||
| BodyTypingMode::Borrowck | BodyTypingMode::PostBorrowck => TypingEnv::new( |
There was a problem hiding this comment.
when do we encounter this?
There was a problem hiding this comment.
The initial mode is BodyTypingMode::Borrowck. After mir_borrowck, we set it to PostBorrowck.
There was a problem hiding this comment.
promote_consts pass would use BodyTypingMode::Borrowck since it's run before borrowck.
| /// us to see the difference and forego optimization on the inlined promoted items. | ||
| pub phase: MirPhase, | ||
|
|
||
| pub typing_mode: BodyTypingMode, |
There was a problem hiding this comment.
comment please :>
| StableHash, | ||
| TypeFoldable, | ||
| TypeVisitable | ||
| )] |
There was a problem hiding this comment.
should also have a comment, or maybe just change the field to go "see [BodyTypingMode] for more info"
also, mind splitting the derive in two so that it doesn't get spread out like this
53c2b35 to
5e23058
Compare
5e23058 to
23a44a9
Compare
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
☔ The latest upstream changes (presumably #164757) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
Similar to #163745
We should discourage constructing a typing env by hand when it can be derived from context.
This simplifies reasoning and reduces the mistake of not resetting rigidness markers across typing envs.
This PR adds an field to
mir::Bodyto track the typing mode.r? lcnr