File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 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 .
2
2
3
3
fn main ( ) {
4
4
let mut a = 5 ;
Original file line number Diff line number Diff line change 1
1
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
3
3
|
4
4
LL | let b = hello;
5
5
| ----- value moved here
6
6
LL | let c = hello;
7
7
| ^^^^^ value used here after move
8
8
|
9
9
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
11
11
|
12
12
LL | a += 1;
13
13
| ^
You can’t perform that action at this time.
0 commit comments