]> git.lizzy.rs Git - rust.git/blob - tests/ui/drop_forget_copy.stderr
Warn on calls to `std::mem::drop` or `std::mem::forget` with a `Copy` type
[rust.git] / tests / ui / drop_forget_copy.stderr
1 error: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
2   --> $DIR/drop_forget_copy.rs:33:5
3    |
4 33 |     drop(s1);
5    |     ^^^^^^^^
6    |
7 note: lint level defined here
8   --> $DIR/drop_forget_copy.rs:4:9
9    |
10 4  | #![deny(drop_copy, forget_copy)]
11    |         ^^^^^^^^^
12 note: argument has type SomeStruct
13   --> $DIR/drop_forget_copy.rs:33:10
14    |
15 33 |     drop(s1);
16    |          ^^
17
18 error: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
19   --> $DIR/drop_forget_copy.rs:34:5
20    |
21 34 |     drop(s2);
22    |     ^^^^^^^^
23    |
24 note: argument has type SomeStruct
25   --> $DIR/drop_forget_copy.rs:34:10
26    |
27 34 |     drop(s2);
28    |          ^^
29
30 error: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
31   --> $DIR/drop_forget_copy.rs:35:5
32    |
33 35 |     drop(s3);
34    |     ^^^^^^^^
35    |
36 note: argument has type &SomeStruct
37   --> $DIR/drop_forget_copy.rs:35:10
38    |
39 35 |     drop(s3);
40    |          ^^
41
42 error: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
43   --> $DIR/drop_forget_copy.rs:36:5
44    |
45 36 |     drop(s4);
46    |     ^^^^^^^^
47    |
48 note: argument has type SomeStruct
49   --> $DIR/drop_forget_copy.rs:36:10
50    |
51 36 |     drop(s4);
52    |          ^^
53
54 error: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
55   --> $DIR/drop_forget_copy.rs:37:5
56    |
57 37 |     drop(s5);
58    |     ^^^^^^^^
59    |
60 note: argument has type &SomeStruct
61   --> $DIR/drop_forget_copy.rs:37:10
62    |
63 37 |     drop(s5);
64    |          ^^
65
66 error: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
67   --> $DIR/drop_forget_copy.rs:39:5
68    |
69 39 |     forget(s1);
70    |     ^^^^^^^^^^
71    |
72 note: lint level defined here
73   --> $DIR/drop_forget_copy.rs:4:20
74    |
75 4  | #![deny(drop_copy, forget_copy)]
76    |                    ^^^^^^^^^^^
77 note: argument has type SomeStruct
78   --> $DIR/drop_forget_copy.rs:39:12
79    |
80 39 |     forget(s1);
81    |            ^^
82
83 error: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
84   --> $DIR/drop_forget_copy.rs:40:5
85    |
86 40 |     forget(s2);
87    |     ^^^^^^^^^^
88    |
89 note: argument has type SomeStruct
90   --> $DIR/drop_forget_copy.rs:40:12
91    |
92 40 |     forget(s2);
93    |            ^^
94
95 error: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
96   --> $DIR/drop_forget_copy.rs:41:5
97    |
98 41 |     forget(s3);
99    |     ^^^^^^^^^^
100    |
101 note: argument has type &SomeStruct
102   --> $DIR/drop_forget_copy.rs:41:12
103    |
104 41 |     forget(s3);
105    |            ^^
106
107 error: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
108   --> $DIR/drop_forget_copy.rs:42:5
109    |
110 42 |     forget(s4);
111    |     ^^^^^^^^^^
112    |
113 note: argument has type SomeStruct
114   --> $DIR/drop_forget_copy.rs:42:12
115    |
116 42 |     forget(s4);
117    |            ^^
118
119 error: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
120   --> $DIR/drop_forget_copy.rs:43:5
121    |
122 43 |     forget(s5);
123    |     ^^^^^^^^^^
124    |
125 note: argument has type &SomeStruct
126   --> $DIR/drop_forget_copy.rs:43:12
127    |
128 43 |     forget(s5);
129    |            ^^
130
131 error: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
132   --> $DIR/drop_forget_copy.rs:51:5
133    |
134 51 |     drop(a2);
135    |     ^^^^^^^^
136    |
137 note: argument has type &AnotherStruct
138   --> $DIR/drop_forget_copy.rs:51:10
139    |
140 51 |     drop(a2);
141    |          ^^
142
143 error: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
144   --> $DIR/drop_forget_copy.rs:53:5
145    |
146 53 |     drop(a4);
147    |     ^^^^^^^^
148    |
149 note: argument has type &AnotherStruct
150   --> $DIR/drop_forget_copy.rs:53:10
151    |
152 53 |     drop(a4);
153    |          ^^
154
155 error: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
156   --> $DIR/drop_forget_copy.rs:56:5
157    |
158 56 |     forget(a2);
159    |     ^^^^^^^^^^
160    |
161 note: argument has type &AnotherStruct
162   --> $DIR/drop_forget_copy.rs:56:12
163    |
164 56 |     forget(a2);
165    |            ^^
166
167 error: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
168   --> $DIR/drop_forget_copy.rs:58:5
169    |
170 58 |     forget(a3);
171    |     ^^^^^^^^^^
172    |
173 note: argument has type &AnotherStruct
174   --> $DIR/drop_forget_copy.rs:58:12
175    |
176 58 |     forget(a3);
177    |            ^^
178
179 error: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
180   --> $DIR/drop_forget_copy.rs:59:5
181    |
182 59 |     forget(a4);
183    |     ^^^^^^^^^^
184    |
185 note: argument has type &AnotherStruct
186   --> $DIR/drop_forget_copy.rs:59:12
187    |
188 59 |     forget(a4);
189    |            ^^
190
191 error: aborting due to 15 previous errors
192