mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
11 lines
246 B
Rust
11 lines
246 B
Rust
// Check that closures do not implement `Copy` if their environment is not `Copy`.
|
|
|
|
fn main() {
|
|
let mut a = 5;
|
|
let hello = || {
|
|
a += 1;
|
|
};
|
|
|
|
let b = hello;
|
|
let c = hello; //~ ERROR use of moved value: `hello` [E0382]
|
|
}
|