Skip to content
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

Merged
merged 1 commit into from
Apr 11, 2020

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Apr 9, 2020

fixes #70905

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 9, 2020
@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 9, 2020

📌 Commit 8a03147 has been approved by matthewjasper

@bors
Copy link
Contributor

bors commented Apr 9, 2020

🌲 The tree is currently closed for pull requests below priority 10, this pull request will be tested once the tree is reopened

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 9, 2020
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);
Copy link
Member

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.

Copy link
Contributor Author

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.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 10, 2020
…, r=matthewjasper

Normalize MIR locals' types for generator layout computation.

fixes rust-lang#70905
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 11, 2020
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
@bors bors merged commit eec86ba into rust-lang:master Apr 11, 2020
@oli-obk oli-obk deleted the lazy_repeat_length_eval_ice branch April 14, 2020 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE on generators + arrays
5 participants