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