]> git.lizzy.rs Git - rust.git/commit
Add closure cannot be moved note.
authorDavid Wood <david@davidtw.co>
Mon, 24 Dec 2018 14:29:40 +0000 (15:29 +0100)
committerDavid Wood <david@davidtw.co>
Wed, 26 Dec 2018 20:55:45 +0000 (21:55 +0100)
commitfcad2094497519989327e372c09f9470bac7f957
tree178c94e934dfb380561272d08a7a4f1bcffef5d5
parent79d8a0fcefa5134db2a94739b1d18daa01fc6e9f
Add closure cannot be moved note.

This commit 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.
src/librustc_mir/borrow_check/error_reporting.rs
src/test/ui/not-copy-closure.nll.stderr