NLL: Unhelpful error message for borrowing non-static values in a 'static closure #49712
Labels
A-NLL
Area: Non-lexical lifetimes (NLL)
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
NLL-diagnostics
Working towards the "diagnostic parity" goal
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
Milestone
The error that is shown when borrowing a value inside a closure that doesn't outlive the closure (when the closure has a
'static
bound) seems misleading and less helpful than the old one. (especially since the hint to make it amove
closure is missing)Code snippet:
Error without NLL:
Error with NLL:
The text was updated successfully, but these errors were encountered: