Closed
Description
struct NoCopy;
fn main() {
let x = NoCopy;
let f = move || { let y = x; };
let z = x;
}
<anon>:5:8: 5:9 error: use of moved value: `x`
<anon>:5 let z = x;
^
<anon>:4:17: 4:34 note: `x` moved into closure environment here because it has type `[closure(())]`, which is non-copyable
<anon>:4 let f = move || { let y = x; };
^~~~~~~~~~~~~~~~~
<anon>:4:34: 4:34 help: perhaps you meant to use `clone()`?
Presumably the error message should say because it has type
NoCopy which is non-copyable
.