]> git.lizzy.rs Git - rust.git/blob - tests/ui/undocumented_unsafe_blocks.stderr
Lint unnecessary safety comments on statements and block tail expressions
[rust.git] / tests / ui / undocumented_unsafe_blocks.stderr
1 error: unsafe block missing a safety comment
2   --> $DIR/undocumented_unsafe_blocks.rs:262:19
3    |
4 LL |     /* Safety: */ unsafe {}
5    |                   ^^^^^^^^^
6    |
7    = help: consider adding a safety comment on the preceding line
8    = note: `-D clippy::undocumented-unsafe-blocks` implied by `-D warnings`
9
10 error: unsafe block missing a safety comment
11   --> $DIR/undocumented_unsafe_blocks.rs:266:5
12    |
13 LL |     unsafe {}
14    |     ^^^^^^^^^
15    |
16    = help: consider adding a safety comment on the preceding line
17
18 error: unsafe block missing a safety comment
19   --> $DIR/undocumented_unsafe_blocks.rs:270:14
20    |
21 LL |     let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
22    |              ^^^^^^^^^^^^^
23    |
24    = help: consider adding a safety comment on the preceding line
25
26 error: unsafe block missing a safety comment
27   --> $DIR/undocumented_unsafe_blocks.rs:270:29
28    |
29 LL |     let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
30    |                             ^^^^^^^^^^^^^
31    |
32    = help: consider adding a safety comment on the preceding line
33
34 error: unsafe block missing a safety comment
35   --> $DIR/undocumented_unsafe_blocks.rs:270:48
36    |
37 LL |     let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
38    |                                                ^^^^^^^^^^^^^
39    |
40    = help: consider adding a safety comment on the preceding line
41
42 error: unsafe block missing a safety comment
43   --> $DIR/undocumented_unsafe_blocks.rs:274:18
44    |
45 LL |     let _ = (42, unsafe {}, "test", unsafe {});
46    |                  ^^^^^^^^^
47    |
48    = help: consider adding a safety comment on the preceding line
49
50 error: unsafe block missing a safety comment
51   --> $DIR/undocumented_unsafe_blocks.rs:274:37
52    |
53 LL |     let _ = (42, unsafe {}, "test", unsafe {});
54    |                                     ^^^^^^^^^
55    |
56    = help: consider adding a safety comment on the preceding line
57
58 error: unsafe block missing a safety comment
59   --> $DIR/undocumented_unsafe_blocks.rs:278:14
60    |
61 LL |     let _ = *unsafe { &42 };
62    |              ^^^^^^^^^^^^^^
63    |
64    = help: consider adding a safety comment on the preceding line
65
66 error: unsafe block missing a safety comment
67   --> $DIR/undocumented_unsafe_blocks.rs:283:19
68    |
69 LL |     let _ = match unsafe {} {
70    |                   ^^^^^^^^^
71    |
72    = help: consider adding a safety comment on the preceding line
73
74 error: unsafe block missing a safety comment
75   --> $DIR/undocumented_unsafe_blocks.rs:289:14
76    |
77 LL |     let _ = &unsafe {};
78    |              ^^^^^^^^^
79    |
80    = help: consider adding a safety comment on the preceding line
81
82 error: unsafe block missing a safety comment
83   --> $DIR/undocumented_unsafe_blocks.rs:293:14
84    |
85 LL |     let _ = [unsafe {}; 5];
86    |              ^^^^^^^^^
87    |
88    = help: consider adding a safety comment on the preceding line
89
90 error: unsafe block missing a safety comment
91   --> $DIR/undocumented_unsafe_blocks.rs:297:13
92    |
93 LL |     let _ = unsafe {};
94    |             ^^^^^^^^^
95    |
96    = help: consider adding a safety comment on the preceding line
97
98 error: unsafe block missing a safety comment
99   --> $DIR/undocumented_unsafe_blocks.rs:307:8
100    |
101 LL |     t!(unsafe {});
102    |        ^^^^^^^^^
103    |
104    = help: consider adding a safety comment on the preceding line
105
106 error: unsafe block missing a safety comment
107   --> $DIR/undocumented_unsafe_blocks.rs:313:13
108    |
109 LL |             unsafe {}
110    |             ^^^^^^^^^
111 ...
112 LL |     t!();
113    |     ---- in this macro invocation
114    |
115    = help: consider adding a safety comment on the preceding line
116    = note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info)
117
118 error: unsafe block missing a safety comment
119   --> $DIR/undocumented_unsafe_blocks.rs:321:5
120    |
121 LL |     unsafe {} // SAFETY:
122    |     ^^^^^^^^^
123    |
124    = help: consider adding a safety comment on the preceding line
125
126 error: unsafe block missing a safety comment
127   --> $DIR/undocumented_unsafe_blocks.rs:325:5
128    |
129 LL |     unsafe {
130    |     ^^^^^^^^
131    |
132    = help: consider adding a safety comment on the preceding line
133
134 error: unsafe block missing a safety comment
135   --> $DIR/undocumented_unsafe_blocks.rs:335:5
136    |
137 LL |     unsafe {};
138    |     ^^^^^^^^^
139    |
140    = help: consider adding a safety comment on the preceding line
141
142 error: unsafe block missing a safety comment
143   --> $DIR/undocumented_unsafe_blocks.rs:339:20
144    |
145 LL |     println!("{}", unsafe { String::from_utf8_unchecked(vec![]) });
146    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147    |
148    = help: consider adding a safety comment on the preceding line
149
150 error: unsafe impl missing a safety comment
151   --> $DIR/undocumented_unsafe_blocks.rs:346:5
152    |
153 LL |     unsafe impl A for () {}
154    |     ^^^^^^^^^^^^^^^^^^^^^^^
155    |
156    = help: consider adding a safety comment on the preceding line
157
158 error: unsafe impl missing a safety comment
159   --> $DIR/undocumented_unsafe_blocks.rs:353:9
160    |
161 LL |         unsafe impl B for (u32) {}
162    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
163    |
164    = help: consider adding a safety comment on the preceding line
165
166 error: unsafe impl missing a safety comment
167   --> $DIR/undocumented_unsafe_blocks.rs:374:13
168    |
169 LL |             unsafe impl T for $t {}
170    |             ^^^^^^^^^^^^^^^^^^^^^^^
171 ...
172 LL |     no_safety_comment!(());
173    |     ---------------------- in this macro invocation
174    |
175    = help: consider adding a safety comment on the preceding line
176    = note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
177
178 error: unsafe impl missing a safety comment
179   --> $DIR/undocumented_unsafe_blocks.rs:399:13
180    |
181 LL |             unsafe impl T for $t {}
182    |             ^^^^^^^^^^^^^^^^^^^^^^^
183 ...
184 LL |     no_safety_comment!(());
185    |     ---------------------- in this macro invocation
186    |
187    = help: consider adding a safety comment on the preceding line
188    = note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
189
190 error: unsafe impl missing a safety comment
191   --> $DIR/undocumented_unsafe_blocks.rs:407:5
192    |
193 LL |     unsafe impl T for (i32) {}
194    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
195    |
196    = help: consider adding a safety comment on the preceding line
197
198 error: unsafe impl missing a safety comment
199   --> $DIR/undocumented_unsafe_blocks.rs:399:13
200    |
201 LL |             unsafe impl T for $t {}
202    |             ^^^^^^^^^^^^^^^^^^^^^^^
203 ...
204 LL |     no_safety_comment!(u32);
205    |     ----------------------- in this macro invocation
206    |
207    = help: consider adding a safety comment on the preceding line
208    = note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
209
210 error: unsafe impl missing a safety comment
211   --> $DIR/undocumented_unsafe_blocks.rs:413:5
212    |
213 LL |     unsafe impl T for (bool) {}
214    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
215    |
216    = help: consider adding a safety comment on the preceding line
217
218 error: unsafe impl missing a safety comment
219   --> $DIR/undocumented_unsafe_blocks.rs:459:5
220    |
221 LL |     unsafe impl NoComment for () {}
222    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
223    |
224    = help: consider adding a safety comment on the preceding line
225
226 error: unsafe impl missing a safety comment
227   --> $DIR/undocumented_unsafe_blocks.rs:463:19
228    |
229 LL |     /* SAFETY: */ unsafe impl InlineComment for () {}
230    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
231    |
232    = help: consider adding a safety comment on the preceding line
233
234 error: unsafe impl missing a safety comment
235   --> $DIR/undocumented_unsafe_blocks.rs:467:5
236    |
237 LL |     unsafe impl TrailingComment for () {} // SAFETY:
238    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
239    |
240    = help: consider adding a safety comment on the preceding line
241
242 error: constant item has unnecessary safety comment
243   --> $DIR/undocumented_unsafe_blocks.rs:471:5
244    |
245 LL |     const BIG_NUMBER: i32 = 1000000;
246    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
247    |
248 help: consider removing the safety comment
249   --> $DIR/undocumented_unsafe_blocks.rs:470:5
250    |
251 LL |     // SAFETY:
252    |     ^^^^^^^^^^
253    = note: `-D clippy::unnecessary-safety-comment` implied by `-D warnings`
254
255 error: unsafe impl missing a safety comment
256   --> $DIR/undocumented_unsafe_blocks.rs:472:5
257    |
258 LL |     unsafe impl Interference for () {}
259    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
260    |
261    = help: consider adding a safety comment on the preceding line
262
263 error: constant item has unnecessary safety comment
264   --> $DIR/undocumented_unsafe_blocks.rs:477:5
265    |
266 LL |     const CONST: u32 = 0;
267    |     ^^^^^^^^^^^^^^^^^^^^^
268    |
269 help: consider removing the safety comment
270   --> $DIR/undocumented_unsafe_blocks.rs:476:5
271    |
272 LL |     // SAFETY:
273    |     ^^^^^^^^^^
274
275 error: static item has unnecessary safety comment
276   --> $DIR/undocumented_unsafe_blocks.rs:479:5
277    |
278 LL |     static STATIC: u32 = 0;
279    |     ^^^^^^^^^^^^^^^^^^^^^^^
280    |
281 help: consider removing the safety comment
282   --> $DIR/undocumented_unsafe_blocks.rs:478:5
283    |
284 LL |     // SAFETY:
285    |     ^^^^^^^^^^
286
287 error: struct has unnecessary safety comment
288   --> $DIR/undocumented_unsafe_blocks.rs:481:5
289    |
290 LL |     struct Struct;
291    |     ^^^^^^^^^^^^^^
292    |
293 help: consider removing the safety comment
294   --> $DIR/undocumented_unsafe_blocks.rs:480:5
295    |
296 LL |     // SAFETY:
297    |     ^^^^^^^^^^
298
299 error: enum has unnecessary safety comment
300   --> $DIR/undocumented_unsafe_blocks.rs:483:5
301    |
302 LL |     enum Enum {}
303    |     ^^^^^^^^^^^^
304    |
305 help: consider removing the safety comment
306   --> $DIR/undocumented_unsafe_blocks.rs:482:5
307    |
308 LL |     // SAFETY:
309    |     ^^^^^^^^^^
310
311 error: module has unnecessary safety comment
312   --> $DIR/undocumented_unsafe_blocks.rs:485:5
313    |
314 LL |     mod module {}
315    |     ^^^^^^^^^^^^^
316    |
317 help: consider removing the safety comment
318   --> $DIR/undocumented_unsafe_blocks.rs:484:5
319    |
320 LL |     // SAFETY:
321    |     ^^^^^^^^^^
322
323 error: unsafe impl missing a safety comment
324   --> $DIR/undocumented_unsafe_blocks.rs:492:5
325    |
326 LL |     unsafe impl ImplInFn for () {}
327    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
328    |
329    = help: consider adding a safety comment on the preceding line
330
331 error: unsafe impl missing a safety comment
332   --> $DIR/undocumented_unsafe_blocks.rs:501:1
333    |
334 LL | unsafe impl CrateRoot for () {}
335    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
336    |
337    = help: consider adding a safety comment on the preceding line
338
339 error: unsafe block missing a safety comment
340   --> $DIR/undocumented_unsafe_blocks.rs:511:9
341    |
342 LL |         unsafe {};
343    |         ^^^^^^^^^
344    |
345    = help: consider adding a safety comment on the preceding line
346
347 error: statement has unnecessary safety comment
348   --> $DIR/undocumented_unsafe_blocks.rs:514:5
349    |
350 LL | /     let _ = {
351 LL | |         if unsafe { true } {
352 LL | |             todo!();
353 LL | |         } else {
354 ...  |
355 LL | |         }
356 LL | |     };
357    | |______^
358    |
359 help: consider removing the safety comment
360   --> $DIR/undocumented_unsafe_blocks.rs:513:5
361    |
362 LL |     // SAFETY: this is more than one level away, so it should warn
363    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
364
365 error: unsafe block missing a safety comment
366   --> $DIR/undocumented_unsafe_blocks.rs:515:12
367    |
368 LL |         if unsafe { true } {
369    |            ^^^^^^^^^^^^^^^
370    |
371    = help: consider adding a safety comment on the preceding line
372
373 error: unsafe block missing a safety comment
374   --> $DIR/undocumented_unsafe_blocks.rs:518:23
375    |
376 LL |             let bar = unsafe {};
377    |                       ^^^^^^^^^
378    |
379    = help: consider adding a safety comment on the preceding line
380
381 error: impl has unnecessary safety comment
382   --> $DIR/undocumented_unsafe_blocks.rs:541:13
383    |
384 LL |             impl T for $t {}
385    |             ^^^^^^^^^^^^^^^^
386 ...
387 LL |     with_safety_comment!(i32);
388    |     ------------------------- in this macro invocation
389    |
390 help: consider removing the safety comment
391   --> $DIR/undocumented_unsafe_blocks.rs:540:13
392    |
393 LL |             // Safety: unnecessary
394    |             ^^^^^^^^^^^^^^^^^^^^^^
395    = note: this error originates in the macro `with_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
396
397 error: expression has unnecessary safety comment
398   --> $DIR/undocumented_unsafe_blocks.rs:553:5
399    |
400 LL |     24
401    |     ^^
402    |
403 help: consider removing the safety comment
404   --> $DIR/undocumented_unsafe_blocks.rs:552:5
405    |
406 LL |     // SAFETY: unnecessary
407    |     ^^^^^^^^^^^^^^^^^^^^^^
408
409 error: statement has unnecessary safety comment
410   --> $DIR/undocumented_unsafe_blocks.rs:550:5
411    |
412 LL |     let num = 42;
413    |     ^^^^^^^^^^^^^
414    |
415 help: consider removing the safety comment
416   --> $DIR/undocumented_unsafe_blocks.rs:549:5
417    |
418 LL |     // SAFETY: unnecessary
419    |     ^^^^^^^^^^^^^^^^^^^^^^
420
421 error: aborting due to 44 previous errors
422