-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[NLL] Improve closure region bound errors #54798
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
[NLL] Improve closure region bound errors #54798
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
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 looks awesome!
(category, span) | ||
} | ||
|
||
fn retrieve_closure_constraint_info( |
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.
Why can't we assign the correct category to begin with?
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.
Because it doesn't really save us very much, since the Constraint doesn't have anywhere to store the Span (I guess one could be added) and there is a PR that I'll be making soon that needs to know when bounds come from closure constraints.
☔ The latest upstream changes (presumably #54649) made this pull request unmergeable. Please resolve the merge conflicts. |
Allows us to use the category of outlive requirements inside a closure when reporting free region errors caused by its closure bounds.
Now use the category and span that are associated to the most interesting bound that led to the closure bound.
a9a448e
to
8258107
Compare
@bors r+ |
📌 Commit 8258107 has been approved by |
…komatsakis [NLL] Improve closure region bound errors Previously, we would report free region errors that originate from closure with the span of the closure and a "closure body requires ..." message. This is now updated to use a reason and span from inside the closure.
☀️ Test successful - status-appveyor, status-travis |
Previously, we would report free region errors that originate from closure with the span of the closure and a "closure body requires ..." message. This is now updated to use a reason and span from inside the closure.