Skip to content
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 Diagnostic Review 3: missing closure cannot be moved note #57098

Closed
davidtwco opened this issue Dec 24, 2018 · 0 comments
Closed

NLL Diagnostic Review 3: missing closure cannot be moved note #57098

davidtwco opened this issue Dec 24, 2018 · 0 comments
Assignees
Labels
A-NLL Area: Non-lexical lifetimes (NLL) NLL-diagnostics Working towards the "diagnostic parity" goal P-low Low priority

Comments

@davidtwco
Copy link
Member

The following note is missing on the output of the NLL borrow checker for: ui/not-copy-closure.nll.stderr

note: closure cannot be invoked more than once because it moves the variable `a` out of its environment
@davidtwco davidtwco self-assigned this Dec 24, 2018
@davidtwco davidtwco changed the title NLL Diagnostic Review 3: Missing closure cannot be moved note NLL Diagnostic Review 3: missing closure cannot be moved note Dec 24, 2018
@davidtwco davidtwco added A-NLL Area: Non-lexical lifetimes (NLL) NLL-diagnostics Working towards the "diagnostic parity" goal P-low Low priority labels Dec 24, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Jan 3, 2019
NLL: Add closure cannot be moved note.

Fixes rust-lang#57098.

This PR extends existing logic for checking whether a closure that
is `FnOnce` and therefore moves variables that it captures from the
environment has already been invoked when being invoked again.

Now, this logic will also check whether the closure is being moved after
previously being moved or invoked and add an appropriate note.

r? @pnkfelix
bors added a commit that referenced this issue Jan 5, 2019
NLL: Add closure cannot be moved note.

Fixes #57098.

This PR extends existing logic for checking whether a closure that
is `FnOnce` and therefore moves variables that it captures from the
environment has already been invoked when being invoked again.

Now, this logic will also check whether the closure is being moved after
previously being moved or invoked and add an appropriate note.

r? @pnkfelix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-NLL Area: Non-lexical lifetimes (NLL) NLL-diagnostics Working towards the "diagnostic parity" goal P-low Low priority
Projects
None yet
Development

No branches or pull requests

1 participant