blob: 2de4ee4eabd58e21691cefac3914c7a0a837ead6 [file] [log] [blame]
Gurinder Singh4b3ece42023-11-03 02:02:101error[E0507]: cannot move out of `self` which is behind a shared reference
2 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
3 |
4LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
5 | ----- in this derive macro expansion
6LL | struct StructA(String);
7 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
8 |
9 = note: `#[derive(Debug)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
10 = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
Esteban Küber10c2fbe2024-03-13 03:41:4111help: consider cloning the value if the performance cost is acceptable
12 |
13LL | struct StructA(String.clone());
14 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:1015
16error[E0507]: cannot move out of `self` which is behind a shared reference
17 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
18 |
19LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
20 | --------- in this derive macro expansion
21LL | struct StructA(String);
22 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
23 |
24 = note: `#[derive(PartialEq)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
25 = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
Esteban Küber10c2fbe2024-03-13 03:41:4126help: consider cloning the value if the performance cost is acceptable
27 |
28LL | struct StructA(String.clone());
29 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:1030
31error[E0507]: cannot move out of `other` which is behind a shared reference
32 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
33 |
34LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
35 | --------- in this derive macro expansion
36LL | struct StructA(String);
37 | ^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
38 |
39 = note: `#[derive(PartialEq)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
40 = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
Esteban Küber10c2fbe2024-03-13 03:41:4141help: consider cloning the value if the performance cost is acceptable
42 |
43LL | struct StructA(String.clone());
44 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:1045
46error[E0507]: cannot move out of `self` which is behind a shared reference
47 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
48 |
49LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
50 | ---------- in this derive macro expansion
51LL | struct StructA(String);
52 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
53 |
54 = note: `#[derive(PartialOrd)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
55 = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
Esteban Küber10c2fbe2024-03-13 03:41:4156help: consider cloning the value if the performance cost is acceptable
57 |
58LL | struct StructA(String.clone());
59 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:1060
61error[E0507]: cannot move out of `other` which is behind a shared reference
62 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
63 |
64LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
65 | ---------- in this derive macro expansion
66LL | struct StructA(String);
67 | ^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
68 |
69 = note: `#[derive(PartialOrd)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
70 = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
Esteban Küber10c2fbe2024-03-13 03:41:4171help: consider cloning the value if the performance cost is acceptable
72 |
73LL | struct StructA(String.clone());
74 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:1075
76error[E0507]: cannot move out of `self` which is behind a shared reference
77 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
78 |
79LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
80 | --- in this derive macro expansion
81LL | struct StructA(String);
82 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
83 |
84 = note: `#[derive(Ord)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
85 = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
Esteban Küber10c2fbe2024-03-13 03:41:4186help: consider cloning the value if the performance cost is acceptable
87 |
88LL | struct StructA(String.clone());
89 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:1090
91error[E0507]: cannot move out of `other` which is behind a shared reference
92 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
93 |
94LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
95 | --- in this derive macro expansion
96LL | struct StructA(String);
97 | ^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
98 |
99 = note: `#[derive(Ord)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
100 = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
Esteban Küber10c2fbe2024-03-13 03:41:41101help: consider cloning the value if the performance cost is acceptable
102 |
103LL | struct StructA(String.clone());
104 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10105
106error[E0507]: cannot move out of `self` which is behind a shared reference
107 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
108 |
109LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
110 | ---- in this derive macro expansion
111LL | struct StructA(String);
112 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
113 |
114 = note: `#[derive(Hash)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
115 = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
Esteban Küber10c2fbe2024-03-13 03:41:41116help: consider cloning the value if the performance cost is acceptable
117 |
118LL | struct StructA(String.clone());
119 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10120
121error[E0507]: cannot move out of `self` which is behind a shared reference
122 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
123 |
124LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
125 | ----- in this derive macro expansion
126LL | struct StructA(String);
127 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
128 |
129 = note: `#[derive(Clone)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
130 = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
Esteban Küber10c2fbe2024-03-13 03:41:41131help: consider cloning the value if the performance cost is acceptable
132 |
133LL | struct StructA(String.clone());
134 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10135
136error[E0507]: cannot move out of `self` which is behind a shared reference
137 --> $DIR/deriving-with-repr-packed-move-errors.rs:28:9
138 |
139LL | self.0
140 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41141 |
142help: consider cloning the value if the performance cost is acceptable
143 |
144LL | self.0.clone()
145 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10146
147error[E0507]: cannot move out of `self` which is behind a shared reference
148 --> $DIR/deriving-with-repr-packed-move-errors.rs:38:20
149 |
150LL | let x = &{ self.0 };
151 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41152 |
153help: consider cloning the value if the performance cost is acceptable
154 |
155LL | let x = &{ self.0.clone() };
156 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10157
158error[E0507]: cannot move out of `self` which is behind a shared reference
159 --> $DIR/deriving-with-repr-packed-move-errors.rs:45:12
160 |
161LL | ({ self.0 }) == ({ other.0 })
162 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41163 |
164help: consider cloning the value if the performance cost is acceptable
165 |
166LL | ({ self.0.clone() }) == ({ other.0 })
167 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10168
169error[E0507]: cannot move out of `other` which is behind a shared reference
170 --> $DIR/deriving-with-repr-packed-move-errors.rs:45:28
171 |
172LL | ({ self.0 }) == ({ other.0 })
173 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41174 |
175help: consider cloning the value if the performance cost is acceptable
176 |
177LL | ({ self.0 }) == ({ other.0.clone() })
178 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10179
180error[E0507]: cannot move out of `self` which is behind a shared reference
181 --> $DIR/deriving-with-repr-packed-move-errors.rs:53:36
182 |
183LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
184 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41185 |
186help: consider cloning the value if the performance cost is acceptable
187 |
188LL | PartialOrd::partial_cmp(&{ self.0.clone() }, &{ other.0 })
189 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10190
191error[E0507]: cannot move out of `other` which is behind a shared reference
192 --> $DIR/deriving-with-repr-packed-move-errors.rs:53:49
193 |
194LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
195 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41196 |
197help: consider cloning the value if the performance cost is acceptable
198 |
199LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0.clone() })
200 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10201
202error[E0507]: cannot move out of `self` which is behind a shared reference
203 --> $DIR/deriving-with-repr-packed-move-errors.rs:68:20
204 |
205LL | let x = &{ self.0 };
206 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41207 |
208help: consider cloning the value if the performance cost is acceptable
209 |
210LL | let x = &{ self.0.clone() };
211 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10212
213error[E0507]: cannot move out of `self` which is behind a shared reference
214 --> $DIR/deriving-with-repr-packed-move-errors.rs:75:12
215 |
216LL | ({ self.0 }) == ({ other.0 })
217 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41218 |
219help: consider cloning the value if the performance cost is acceptable
220 |
221LL | ({ self.0.clone() }) == ({ other.0 })
222 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10223
224error[E0507]: cannot move out of `other` which is behind a shared reference
225 --> $DIR/deriving-with-repr-packed-move-errors.rs:75:28
226 |
227LL | ({ self.0 }) == ({ other.0 })
228 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41229 |
230help: consider cloning the value if the performance cost is acceptable
231 |
232LL | ({ self.0 }) == ({ other.0.clone() })
233 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10234
235error[E0507]: cannot move out of `self` which is behind a shared reference
236 --> $DIR/deriving-with-repr-packed-move-errors.rs:83:36
237 |
238LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
239 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41240 |
241help: consider cloning the value if the performance cost is acceptable
242 |
243LL | PartialOrd::partial_cmp(&{ self.0.clone() }, &{ other.0 })
244 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10245
246error[E0507]: cannot move out of `other` which is behind a shared reference
247 --> $DIR/deriving-with-repr-packed-move-errors.rs:83:49
248 |
249LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
250 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41251 |
252help: consider cloning the value if the performance cost is acceptable
253 |
254LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0.clone() })
255 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10256
257error[E0507]: cannot move out of `arg` which is behind a shared reference
258 --> $DIR/deriving-with-repr-packed-move-errors.rs:92:5
259 |
260LL | arg.0
261 | ^^^^^ move occurs because `arg.0` has type `String`, which does not implement the `Copy` trait
Esteban Küber10c2fbe2024-03-13 03:41:41262 |
263help: consider cloning the value if the performance cost is acceptable
264 |
265LL | arg.0.clone()
266 | ++++++++
Gurinder Singh4b3ece42023-11-03 02:02:10267
268error: aborting due to 21 previous errors
269
270For more information about this error, try `rustc --explain E0507`.