[NLL] Improve closure region bound errors #54798
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
nikomatsakis
left a comment
There was a problem hiding this comment.
This looks awesome!
There was a problem hiding this comment.
Why can't we assign the correct category to begin with?
There was a problem hiding this comment.
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.