Skip to content

NLL: errors from free variables should highlight their span, not span of their lambda expression #51170

Closed
@pnkfelix

Description

@pnkfelix

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.)

Metadata

Metadata

Assignees

Labels

A-NLLArea: Non-lexical lifetimes (NLL)NLL-diagnosticsWorking towards the "diagnostic parity" goal

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions