blob: c538061b365e2aa017d330604b317aed7aff15c6 [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)
11
12error[E0507]: cannot move out of `self` which is behind a shared reference
13 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
14 |
15LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
16 | --------- in this derive macro expansion
17LL | struct StructA(String);
18 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
19 |
20 = note: `#[derive(PartialEq)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
21 = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
22
23error[E0507]: cannot move out of `other` which is behind a shared reference
24 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
25 |
26LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
27 | --------- in this derive macro expansion
28LL | struct StructA(String);
29 | ^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
30 |
31 = note: `#[derive(PartialEq)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
32 = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
33
34error[E0507]: cannot move out of `self` which is behind a shared reference
35 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
36 |
37LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
38 | ---------- in this derive macro expansion
39LL | struct StructA(String);
40 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
41 |
42 = note: `#[derive(PartialOrd)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
43 = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
44
45error[E0507]: cannot move out of `other` which is behind a shared reference
46 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
47 |
48LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
49 | ---------- in this derive macro expansion
50LL | struct StructA(String);
51 | ^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
52 |
53 = note: `#[derive(PartialOrd)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
54 = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
55
56error[E0507]: cannot move out of `self` which is behind a shared reference
57 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
58 |
59LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
60 | --- in this derive macro expansion
61LL | struct StructA(String);
62 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
63 |
64 = note: `#[derive(Ord)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
65 = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
66
67error[E0507]: cannot move out of `other` which is behind a shared reference
68 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
69 |
70LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
71 | --- in this derive macro expansion
72LL | struct StructA(String);
73 | ^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
74 |
75 = note: `#[derive(Ord)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
76 = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
77
78error[E0507]: cannot move out of `self` which is behind a shared reference
79 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
80 |
81LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
82 | ---- in this derive macro expansion
83LL | struct StructA(String);
84 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
85 |
86 = note: `#[derive(Hash)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
87 = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
88
89error[E0507]: cannot move out of `self` which is behind a shared reference
90 --> $DIR/deriving-with-repr-packed-move-errors.rs:13:16
91 |
92LL | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
93 | ----- in this derive macro expansion
94LL | struct StructA(String);
95 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
96 |
97 = note: `#[derive(Clone)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
98 = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
99
100error[E0507]: cannot move out of `self` which is behind a shared reference
101 --> $DIR/deriving-with-repr-packed-move-errors.rs:28:9
102 |
103LL | self.0
104 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
105
106error[E0507]: cannot move out of `self` which is behind a shared reference
107 --> $DIR/deriving-with-repr-packed-move-errors.rs:38:20
108 |
109LL | let x = &{ self.0 };
110 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
111
112error[E0507]: cannot move out of `self` which is behind a shared reference
113 --> $DIR/deriving-with-repr-packed-move-errors.rs:45:12
114 |
115LL | ({ self.0 }) == ({ other.0 })
116 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
117
118error[E0507]: cannot move out of `other` which is behind a shared reference
119 --> $DIR/deriving-with-repr-packed-move-errors.rs:45:28
120 |
121LL | ({ self.0 }) == ({ other.0 })
122 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
123
124error[E0507]: cannot move out of `self` which is behind a shared reference
125 --> $DIR/deriving-with-repr-packed-move-errors.rs:53:36
126 |
127LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
128 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
129
130error[E0507]: cannot move out of `other` which is behind a shared reference
131 --> $DIR/deriving-with-repr-packed-move-errors.rs:53:49
132 |
133LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
134 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
135
136error[E0507]: cannot move out of `self` which is behind a shared reference
137 --> $DIR/deriving-with-repr-packed-move-errors.rs:68:20
138 |
139LL | let x = &{ self.0 };
140 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
141
142error[E0507]: cannot move out of `self` which is behind a shared reference
143 --> $DIR/deriving-with-repr-packed-move-errors.rs:75:12
144 |
145LL | ({ self.0 }) == ({ other.0 })
146 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
147
148error[E0507]: cannot move out of `other` which is behind a shared reference
149 --> $DIR/deriving-with-repr-packed-move-errors.rs:75:28
150 |
151LL | ({ self.0 }) == ({ other.0 })
152 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
153
154error[E0507]: cannot move out of `self` which is behind a shared reference
155 --> $DIR/deriving-with-repr-packed-move-errors.rs:83:36
156 |
157LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
158 | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
159
160error[E0507]: cannot move out of `other` which is behind a shared reference
161 --> $DIR/deriving-with-repr-packed-move-errors.rs:83:49
162 |
163LL | PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
164 | ^^^^^^^ move occurs because `other.0` has type `String`, which does not implement the `Copy` trait
165
166error[E0507]: cannot move out of `arg` which is behind a shared reference
167 --> $DIR/deriving-with-repr-packed-move-errors.rs:92:5
168 |
169LL | arg.0
170 | ^^^^^ move occurs because `arg.0` has type `String`, which does not implement the `Copy` trait
171
172error: aborting due to 21 previous errors
173
174For more information about this error, try `rustc --explain E0507`.