@@ -59,50 +59,50 @@ LL | r.use_ref();
59
59
error[E0382]: borrow of moved value: `x`
60
60
--> $DIR/closure-access-spans.rs:37:5
61
61
|
62
+ LL | fn closure_imm_capture_moved(mut x: String) {
63
+ | ----- move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
62
64
LL | let r = x;
63
65
| - value moved here
64
66
LL | || x.len(); //~ ERROR
65
67
| ^^ - borrow occurs due to use in closure
66
68
| |
67
69
| value borrowed here after move
68
- |
69
- = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
70
70
71
71
error[E0382]: borrow of moved value: `x`
72
72
--> $DIR/closure-access-spans.rs:42:5
73
73
|
74
+ LL | fn closure_mut_capture_moved(mut x: String) {
75
+ | ----- move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
74
76
LL | let r = x;
75
77
| - value moved here
76
78
LL | || x = String::new(); //~ ERROR
77
79
| ^^ - borrow occurs due to use in closure
78
80
| |
79
81
| value borrowed here after move
80
- |
81
- = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
82
82
83
83
error[E0382]: borrow of moved value: `x`
84
84
--> $DIR/closure-access-spans.rs:47:5
85
85
|
86
+ LL | fn closure_unique_capture_moved(x: &mut String) {
87
+ | - move occurs because `x` has type `&mut std::string::String`, which does not implement the `Copy` trait
86
88
LL | let r = x;
87
89
| - value moved here
88
90
LL | || *x = String::new(); //~ ERROR
89
91
| ^^ - borrow occurs due to use in closure
90
92
| |
91
93
| value borrowed here after move
92
- |
93
- = note: move occurs because `x` has type `&mut std::string::String`, which does not implement the `Copy` trait
94
94
95
95
error[E0382]: use of moved value: `x`
96
96
--> $DIR/closure-access-spans.rs:52:5
97
97
|
98
+ LL | fn closure_move_capture_moved(x: &mut String) {
99
+ | - move occurs because `x` has type `&mut std::string::String`, which does not implement the `Copy` trait
98
100
LL | let r = x;
99
101
| - value moved here
100
102
LL | || x; //~ ERROR
101
103
| ^^ - use occurs due to use in closure
102
104
| |
103
105
| value used here after move
104
- |
105
- = note: move occurs because `x` has type `&mut std::string::String`, which does not implement the `Copy` trait
106
106
107
107
error: aborting due to 9 previous errors
108
108
0 commit comments