-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Provide span for declaration of captured variables #53164
Provide span for declaration of captured variables #53164
Conversation
} => | ||
{ | ||
if !self.mir.upvar_decls.is_empty() && | ||
original_path.strip_deref_projections() |
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.
hmm, is strip_deref_projections
enough?
Try a case like this:
{
let x = (vec![22], vec![44]);
expect_fn(|| drop(x.0));
}
does that work?
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.
Fixed.
error[E0507]: cannot move out of captured variable in an `Fn` closure | ||
--> $DIR/issue-52663-span-decl-captured-variable.rs:20:26 | ||
| | ||
LL | expect_fn(|| drop(x.0)); |
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.
shouldn't we highlight something 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.
Oops, forgot to update the label logic with the same changes that made that branch get used in the first place for complex cases like this one. Fixed now.
3de543b
to
3f71e12
Compare
@bors r+ |
📌 Commit 3f71e12f72a7772c32638c2ecfb49a719ec4dcb4 has been approved by |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
3f71e12
to
56232c6
Compare
Oops, fixed! |
@bors r=nikomatsakis |
📌 Commit 56232c6 has been approved by |
…tured-variables, r=nikomatsakis Provide span for declaration of captured variables Part of rust-lang#52663. r? @nikomatsakis
…tured-variables, r=nikomatsakis Provide span for declaration of captured variables Part of rust-lang#52663. r? @nikomatsakis
⌛ Testing commit 56232c6 with merge 6671494d4d7bb088db3c37a2a4c3adf84b245029... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors retry |
⌛ Testing commit 56232c6 with merge 89cf35c978c626cd2db98b3bc904a9e55fa35c57... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
@bors r- Merge conflict. |
56232c6
to
5532e9d
Compare
Rebased. |
@bors r+ |
📌 Commit 5532e9d has been approved by |
…bles, r=nikomatsakis Provide span for declaration of captured variables Part of #52663. r? @nikomatsakis
☀️ Test successful - status-appveyor, status-travis |
Part of #52663.
r? @nikomatsakis