]> git.lizzy.rs Git - rust.git/blob - src/test/ui/not-copy-closure.rs
Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth
[rust.git] / src / test / ui / not-copy-closure.rs
1 // Check that closures do not implement `Copy` if their environment is not `Copy`.
2
3 fn main() {
4     let mut a = 5;
5     let hello = || {
6         a += 1;
7     };
8
9     let b = hello;
10     let c = hello; //~ ERROR use of moved value: `hello` [E0382]
11 }