Skip to content

RFC2229 Only compute place if upvars can be resolved#88039

Merged
bors merged 1 commit into
rust-lang:masterfrom
sexxi-goose:fix-87987
Aug 20, 2021
Merged

RFC2229 Only compute place if upvars can be resolved#88039
bors merged 1 commit into
rust-lang:masterfrom
sexxi-goose:fix-87987

Conversation

@roxelo

@roxelo roxelo commented Aug 15, 2021

Copy link
Copy Markdown
Contributor

Closes #87987

This PR fixes an ICE when trying to unwrap an Err. This error appears when trying to convert a PlaceBuilder into Place when upvars can't yet be resolved. We should only try to convert a PlaceBuilder into Place if upvars can be resolved.

r? @nikomatsakis

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 15, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This warning is inconsistent with what happens when let _: Props = props_2; is used outside of a closure. This is a different problem so I have created a new issue for it.

rust-lang/project-rfc-2229#57

@rust-log-analyzer

This comment has been minimized.

@nikomatsakis nikomatsakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roxelo have some questions...

var_ty: ty,
binding_mode: mode,
});
if let Ok(place_resolved) =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what conditions would this fail to succeed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the case we dont capture the root variable

.ty(&self.local_decls, tcx)
.ty
.kind()
let (min_length, exact_size) = if let Ok(place_resolved) =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likewise here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let _: Props = props_2; when we don't let it ice on line 158 of the simplify.rs file

@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Aug 19, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit 9c32b5b has been approved by nikomatsakis

@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 Aug 19, 2021
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors p=1 - wanted for crater in #87066

camsteffen added a commit to camsteffen/rust that referenced this pull request Aug 19, 2021
RFC2229 Only compute place if upvars can be resolved

Closes rust-lang#87987

This PR fixes an ICE when trying to unwrap an Err. This error appears when trying to convert a PlaceBuilder into Place when upvars can't yet be resolved. We should only try to convert a PlaceBuilder into Place if upvars can be resolved.

r? `@nikomatsakis`
@bors

bors commented Aug 20, 2021

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 9c32b5b with merge 7611fe4...

@bors

bors commented Aug 20, 2021

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: nikomatsakis
Pushing 7611fe4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 20, 2021
@bors bors merged commit 7611fe4 into rust-lang:master Aug 20, 2021
@rustbot rustbot added this to the 1.56.0 milestone Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. 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: unwrap on an Err PlaceBuilder

9 participants