]> git.lizzy.rs Git - rust.git/blob - src/test/ui/not-copy-closure.rs
Add 'src/tools/miri/' from commit '75dd959a3a40eb5b4574f8d2e23aa6efbeb33573'
[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 }