File: borrowck-struct-update-with-dtor.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (191 lines) | stat: -rw-r--r-- 8,157 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
error[E0509]: cannot move out of type `S<()>`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:20:19
   |
LL |         let _s2 = S { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.b` has type `B`, which does not implement the `Copy` trait
   |
note: `B` doesn't implement `Copy` or `Clone`
  --> $DIR/borrowck-struct-update-with-dtor.rs:4:1
   |
LL | struct B;
   | ^^^^^^^^
help: if `B` implemented `Clone`, you could clone the value from the field instead of using the functional record update syntax
   |
LL |         let _s2 = S { a: 2, b: s0.b.clone(), ..s0 };
   |                           +++++++++++++++++

error[E0509]: cannot move out of type `S<B>`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:24:19
   |
LL |         let _s2 = S { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.b` has type `B`, which does not implement the `Copy` trait
   |
note: `B` doesn't implement `Copy` or `Clone`
  --> $DIR/borrowck-struct-update-with-dtor.rs:4:1
   |
LL | struct B;
   | ^^^^^^^^
help: if `B` implemented `Clone`, you could clone the value from the field instead of using the functional record update syntax
   |
LL |         let _s2 = S { a: 2, b: s0.b.clone(), c: s0.c.clone() };
   |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0509]: cannot move out of type `S<B>`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:24:19
   |
LL |         let _s2 = S { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.c` has type `B`, which does not implement the `Copy` trait
   |
note: `B` doesn't implement `Copy` or `Clone`
  --> $DIR/borrowck-struct-update-with-dtor.rs:4:1
   |
LL | struct B;
   | ^^^^^^^^
help: if `B` implemented `Clone`, you could clone the value from the field instead of using the functional record update syntax
   |
LL |         let _s2 = S { a: 2, b: s0.b.clone(), c: s0.c.clone() };
   |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0509]: cannot move out of type `S<K>`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:29:19
   |
LL |         let _s2 = S { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.b` has type `B`, which does not implement the `Copy` trait
   |
note: `B` doesn't implement `Copy` or `Clone`
  --> $DIR/borrowck-struct-update-with-dtor.rs:4:1
   |
LL | struct B;
   | ^^^^^^^^
help: if `B` implemented `Clone`, you could clone the value from the field instead of using the functional record update syntax
   |
LL |         let _s2 = S { a: 2, b: s0.b.clone(), ..s0 };
   |                           +++++++++++++++++

error[E0509]: cannot move out of type `S<K>`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:29:19
   |
LL |         let _s2 = S { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.c` has type `K`, which does not implement the `Copy` trait
   |
help: clone the value from the field instead of using the functional record update syntax
   |
LL |         let _s2 = S { a: 2, c: s0.c.clone(), ..s0 };
   |                           +++++++++++++++++

error[E0509]: cannot move out of type `T`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:37:19
   |
LL |         let _s2 = T { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.b` has type `Box<isize>`, which does not implement the `Copy` trait
   |
help: clone the value from the field instead of using the functional record update syntax
   |
LL |         let _s2 = T { a: 2, b: s0.b.clone() };
   |                           ~~~~~~~~~~~~~~~~~

error[E0509]: cannot move out of type `T`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:42:19
   |
LL |         let _s2 = T { ..s0 };
   |                   ^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.b` has type `Box<isize>`, which does not implement the `Copy` trait
   |
help: clone the value from the field instead of using the functional record update syntax
   |
LL |         let _s2 = T { b: s0.b.clone(), ..s0 };
   |                     ~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0509]: cannot move out of type `T`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:47:32
   |
LL |         let _s2 = T { a: 2, b: s0.b };
   |                                ^^^^
   |                                |
   |                                cannot move out of here
   |                                move occurs because `s0.b` has type `Box<isize>`, which does not implement the `Copy` trait
   |
help: consider cloning the value if the performance cost is acceptable
   |
LL |         let _s2 = T { a: 2, b: s0.b.clone() };
   |                                    ++++++++

error[E0509]: cannot move out of type `V<K>`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:52:19
   |
LL |         let _s2 = V { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.b` has type `Box<isize>`, which does not implement the `Copy` trait
   |
help: clone the value from the field instead of using the functional record update syntax
   |
LL |         let _s2 = V { a: 2, b: s0.b.clone(), ..s0 };
   |                           +++++++++++++++++

error[E0509]: cannot move out of type `V<K>`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:52:19
   |
LL |         let _s2 = V { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.c` has type `K`, which does not implement the `Copy` trait
   |
help: clone the value from the field instead of using the functional record update syntax
   |
LL |         let _s2 = V { a: 2, c: s0.c.clone(), ..s0 };
   |                           +++++++++++++++++

error[E0509]: cannot move out of type `V<Clonable>`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:58:19
   |
LL |         let _s2 = V { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.b` has type `Box<isize>`, which does not implement the `Copy` trait
   |
help: clone the value from the field instead of using the functional record update syntax
   |
LL |         let _s2 = V { a: 2, b: s0.b.clone(), ..s0 };
   |                           +++++++++++++++++

error[E0509]: cannot move out of type `V<Clonable>`, which implements the `Drop` trait
  --> $DIR/borrowck-struct-update-with-dtor.rs:58:19
   |
LL |         let _s2 = V { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.c` has type `Clonable`, which does not implement the `Copy` trait
   |
help: clone the value from the field instead of using the functional record update syntax
   |
LL |         let _s2 = V { a: 2, c: s0.c.clone(), ..s0 };
   |                           +++++++++++++++++

error: aborting due to 12 previous errors

For more information about this error, try `rustc --explain E0509`.