-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
RFC2229 Only compute place if upvars can be resolved #88039
Conversation
|
||
fn main() { | ||
// Test 1 | ||
let props_2 = Props { //~ WARNING: unused variable: `props_2` |
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.
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.
This comment has been minimized.
This comment has been minimized.
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.
@roxelo have some questions...
var_ty: ty, | ||
binding_mode: mode, | ||
}); | ||
if let Ok(place_resolved) = |
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.
Under what conditions would this fail to succeed?
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.
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) = |
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.
likewise here
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.
let _: Props = props_2;
when we don't let it ice on line 158 of the simplify.rs file
@bors r+ |
📌 Commit 9c32b5b has been approved by |
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`
☀️ Test successful - checks-actions |
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