Skip to content

Commit ad754e9

Browse files
committed
not-copy-closure
1 parent ce8bf66 commit ad754e9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/ui/closures/closure-no-copy-mut-env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Check that closures do not implement `Copy` if their environment is not `Copy`.
1+
//! Closures do not implement `Copy` when they capture mutable references.
22
33
fn main() {
44
let mut a = 5;

tests/ui/closures/closure-no-copy-mut-env.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0382]: use of moved value: `hello`
2-
--> $DIR/not-copy-closure.rs:10:13
2+
--> $DIR/closure-no-copy-mut-env.rs:10:13
33
|
44
LL | let b = hello;
55
| ----- value moved here
66
LL | let c = hello;
77
| ^^^^^ value used here after move
88
|
99
note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `a` out of its environment
10-
--> $DIR/not-copy-closure.rs:6:9
10+
--> $DIR/closure-no-copy-mut-env.rs:6:9
1111
|
1212
LL | a += 1;
1313
| ^

0 commit comments

Comments
 (0)