@@ -29,27 +29,6 @@ LL | struct StructA(String);
2929 = note: `#[derive(PartialEq)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
3030 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3131
32- error[E0507]: cannot move out of a shared reference
33- --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
34- |
35- LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
36- | ---------- in this derive macro expansion
37- LL | struct StructA(String);
38- | ^^^^^^ move occurs because value has type `String`, which does not implement the `Copy` trait
39- |
40- = note: `#[derive(PartialOrd)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
41-
42- error[E0507]: cannot move out of a shared reference
43- --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
44- |
45- LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
46- | ---------- in this derive macro expansion
47- LL | struct StructA(String);
48- | ^^^^^^ move occurs because value has type `String`, which does not implement the `Copy` trait
49- |
50- = note: `#[derive(PartialOrd)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
51- = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
52-
5332error[E0507]: cannot move out of a shared reference
5433 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
5534 |
@@ -92,7 +71,7 @@ LL | struct StructA(String);
9271 = note: `#[derive(Clone)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
9372
9473error[E0507]: cannot move out of `self` which is behind a shared reference
95- --> $DIR/deriving-with-repr-packed-move-errors.rs:28 :9
74+ --> $DIR/deriving-with-repr-packed-move-errors.rs:26 :9
9675 |
9776LL | self.0
9877 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
@@ -103,7 +82,7 @@ LL | self.0.clone()
10382 | ++++++++
10483
10584error[E0507]: cannot move out of `self` which is behind a shared reference
106- --> $DIR/deriving-with-repr-packed-move-errors.rs:38 :20
85+ --> $DIR/deriving-with-repr-packed-move-errors.rs:36 :20
10786 |
10887LL | let x = &{ self.0 };
10988 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
@@ -114,7 +93,7 @@ LL | let x = &{ self.0.clone() };
11493 | ++++++++
11594
11695error[E0507]: cannot move out of `self` which is behind a shared reference
117- --> $DIR/deriving-with-repr-packed-move-errors.rs:45 :12
96+ --> $DIR/deriving-with-repr-packed-move-errors.rs:43 :12
11897 |
11998LL | ({ self.0 }) == ({ other.0 })
12099 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
@@ -125,7 +104,7 @@ LL | ({ self.0.clone() }) == ({ other.0 })
125104 | ++++++++
126105
127106error[E0507]: cannot move out of `other` which is behind a shared reference
128- --> $DIR/deriving-with-repr-packed-move-errors.rs:45 :28
107+ --> $DIR/deriving-with-repr-packed-move-errors.rs:43 :28
129108 |
130109LL | ({ self.0 }) == ({ other.0 })
131110 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
@@ -136,7 +115,7 @@ LL | ({ self.0 }) == ({ other.0.clone() })
136115 | ++++++++
137116
138117error[E0507]: cannot move out of `self` which is behind a shared reference
139- --> $DIR/deriving-with-repr-packed-move-errors.rs:53 :36
118+ --> $DIR/deriving-with-repr-packed-move-errors.rs:51 :36
140119 |
141120LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
142121 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
@@ -147,7 +126,7 @@ LL | PartialOrd::partial_cmp(&{ self.0.clone() }, &{ other.0 })
147126 | ++++++++
148127
149128error[E0507]: cannot move out of `other` which is behind a shared reference
150- --> $DIR/deriving-with-repr-packed-move-errors.rs:53 :49
129+ --> $DIR/deriving-with-repr-packed-move-errors.rs:51 :49
151130 |
152131LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
153132 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
@@ -158,7 +137,7 @@ LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0.clone() })
158137 | ++++++++
159138
160139error[E0507]: cannot move out of `self` which is behind a shared reference
161- --> $DIR/deriving-with-repr-packed-move-errors.rs:68 :20
140+ --> $DIR/deriving-with-repr-packed-move-errors.rs:66 :20
162141 |
163142LL | let x = &{ self.0 };
164143 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
@@ -169,7 +148,7 @@ LL | let x = &{ self.0.clone() };
169148 | ++++++++
170149
171150error[E0507]: cannot move out of `self` which is behind a shared reference
172- --> $DIR/deriving-with-repr-packed-move-errors.rs:75 :12
151+ --> $DIR/deriving-with-repr-packed-move-errors.rs:73 :12
173152 |
174153LL | ({ self.0 }) == ({ other.0 })
175154 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
@@ -180,7 +159,7 @@ LL | ({ self.0.clone() }) == ({ other.0 })
180159 | ++++++++
181160
182161error[E0507]: cannot move out of `other` which is behind a shared reference
183- --> $DIR/deriving-with-repr-packed-move-errors.rs:75 :28
162+ --> $DIR/deriving-with-repr-packed-move-errors.rs:73 :28
184163 |
185164LL | ({ self.0 }) == ({ other.0 })
186165 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
@@ -191,7 +170,7 @@ LL | ({ self.0 }) == ({ other.0.clone() })
191170 | ++++++++
192171
193172error[E0507]: cannot move out of `self` which is behind a shared reference
194- --> $DIR/deriving-with-repr-packed-move-errors.rs:83 :36
173+ --> $DIR/deriving-with-repr-packed-move-errors.rs:81 :36
195174 |
196175LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
197176 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
@@ -202,7 +181,7 @@ LL | PartialOrd::partial_cmp(&{ self.0.clone() }, &{ other.0 })
202181 | ++++++++
203182
204183error[E0507]: cannot move out of `other` which is behind a shared reference
205- --> $DIR/deriving-with-repr-packed-move-errors.rs:83 :49
184+ --> $DIR/deriving-with-repr-packed-move-errors.rs:81 :49
206185 |
207186LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
208187 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
@@ -213,7 +192,7 @@ LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0.clone() })
213192 | ++++++++
214193
215194error[E0507]: cannot move out of `arg` which is behind a shared reference
216- --> $DIR/deriving-with-repr-packed-move-errors.rs:92 :5
195+ --> $DIR/deriving-with-repr-packed-move-errors.rs:90 :5
217196 |
218197LL | arg.0
219198 | ^^^^^ move occurs because `arg.0` has type `String`, which does not implement the `Copy` trait
@@ -223,6 +202,6 @@ help: consider cloning the value if the performance cost is acceptable
223202LL | arg.0.clone()
224203 | ++++++++
225204
226- error: aborting due to 21 previous errors
205+ error: aborting due to 19 previous errors
227206
228207For more information about this error, try `rustc --explain E0507`.
0 commit comments