NLL: errors from free variables should highlight their span, not span of their lambda expression #51170
Labels
A-NLL
Area: Non-lexical lifetimes (NLL)
NLL-diagnostics
Working towards the "diagnostic parity" goal
Milestone
Uh oh!
There was an error while loading. Please reload this page.
NLL has regressed some test cases in that it will highlight the whole span of a lambda expression (i.e. the
|args, ... | { body ... }
) rather than focus in on the occurrence(s) of the relevant free variable(s) within that lambda expression.One instances of this is:
https://github.com/rust-lang/rust/blob/master/src/test/ui/region-borrow-params-issue-29793-small.nll.stderr
compare that output with that from the old AST borrowck:
https://github.com/rust-lang/rust/blob/master/src/test/ui/region-borrow-params-issue-29793-small.nll.stderr
(In addition, AST borrowck is noting that such a capture of a free variable is occurring, and highlights the parameter list saying "capture occurs here"; but this additional detail seems like very low priority to fix, if we want to fix it at all.)
The text was updated successfully, but these errors were encountered: