-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Normalize MIR locals' types for generator layout computation. #70957
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ |
📌 Commit 8a03147 has been approved by |
🌲 The tree is currently closed for pull requests below priority 10, this pull request will be tested once the tree is reopened |
for (local, decl) in body.local_decls.iter_enumerated() { | ||
// Ignore locals which are internal or not live | ||
if !live_locals.contains(local) || decl.internal { | ||
continue; | ||
} | ||
let decl_ty = tcx.normalize_erasing_regions(param_env, decl.ty); |
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.
Do you think maybe we should be normalizing during typeck? (i.e. have typeck's to_const
call .eval(self.param_env)
on the constant it creates)
Check out the commit titled "borrow_check/type_check: normalize Aggregate
and Call
operands.", required to fix #70773, from my PR #70452. Maybe we could fix that issue and this one by just normalizing early.
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 was wondering where else to do this if not here. Since normalization is just a best-effort thing (at least around constants), doing it earlier is fine, as long as the param_env
at the earlier site has the same bounds as this one here. Since generator expansion happens happens after inlining, I'm not so sure about that. For this specific ICE it should be fine though.
…, r=matthewjasper Normalize MIR locals' types for generator layout computation. fixes rust-lang#70905
Rollup of 5 pull requests Successful merges: - rust-lang#69573 (tests encoding current behavior for various cases of "binding" to _.) - rust-lang#70881 (bootstrap: work around "unused attribute" errors in incremental stdlib rebuilds.) - rust-lang#70957 (Normalize MIR locals' types for generator layout computation.) - rust-lang#70962 (added machine hooks to track deallocations) - rust-lang#70982 (Normalize function signature in function casting check procedure) Failed merges: r? @ghost
fixes #70905