@@ -247,10 +247,10 @@ LL | const BIG_NUMBER: i32 = 1000000;
247247 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
248248 |
249249help: consider removing the safety comment
250- --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:507:5
250+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:507:8
251251 |
252252LL | // SAFETY:
253- | ^^^ ^^^^^^^
253+ | ^^^^^^^
254254 = note: `-D clippy::unnecessary-safety-comment` implied by `-D warnings`
255255 = help: to override `-D warnings` add `#[allow(clippy::unnecessary_safety_comment)]`
256256
@@ -289,10 +289,10 @@ LL | | };
289289 | |______^
290290 |
291291help: consider removing the safety comment
292- --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:542:5
292+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:542:8
293293 |
294294LL | // SAFETY: this is more than one level away, so it should warn
295- | ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
295+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
296296
297297error: unsafe block missing a safety comment
298298 --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:545:12
@@ -342,17 +342,137 @@ LL | const NO_SAFETY_IN_IMPL: i32 = unsafe { 1 };
342342 |
343343 = help: consider adding a safety comment on the preceding line
344344
345+ error: constant has unnecessary safety comment
346+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:701:5
347+ |
348+ LL | const UNIX_EPOCH_JULIAN_DAY: i32 =
349+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
350+ |
351+ help: consider removing the safety comment
352+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:699:8
353+ |
354+ LL | // SAFETY: fail ONLY if `accept-comment-above-attribute = false`
355+ | ^^^^^^^
356+
345357error: statement has unnecessary safety comment
346- --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:719 :5
358+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:721 :5
347359 |
348360LL | _ = bar();
349361 | ^^^^^^^^^^
350362 |
351363help: consider removing the safety comment
352- --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:718:5
364+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:720:8
353365 |
354366LL | // SAFETY: unnecessary_safety_comment triggers here
355- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
367+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
368+
369+ error: module has unnecessary safety comment
370+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:741:5
371+ |
372+ LL | mod x {}
373+ | ^^^^^^^^
374+ |
375+ help: consider removing the safety comment
376+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:740:8
377+ |
378+ LL | // SAFETY: ...
379+ | ^^^^^^^
380+
381+ error: module has unnecessary safety comment
382+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:746:5
383+ |
384+ LL | mod y {}
385+ | ^^^^^^^^
386+ |
387+ help: consider removing the safety comment
388+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:744:8
389+ |
390+ LL | // SAFETY: ...
391+ | ^^^^^^^
392+
393+ error: module has unnecessary safety comment
394+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:751:5
395+ |
396+ LL | mod z {}
397+ | ^^^^^^^^
398+ |
399+ help: consider removing the safety comment
400+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:750:8
401+ |
402+ LL | // SAFETY: ...
403+ | ^^^^^^^
404+
405+ error: module has unnecessary safety comment
406+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:759:5
407+ |
408+ LL | mod y {}
409+ | ^^^^^^^^
410+ |
411+ help: consider removing the safety comment
412+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:757:8
413+ |
414+ LL | // SAFETY: ...
415+ | ^^^^^^^
416+
417+ error: statement has unnecessary safety comment
418+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:774:9
419+ |
420+ LL | let x = 34;
421+ | ^^^^^^^^^^^
422+ |
423+ help: consider removing the safety comment
424+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:772:12
425+ |
426+ LL | // SAFETY: ...
427+ | ^^^^^^^^^^^
428+
429+ error: function has unnecessary safety comment
430+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:781:5
431+ |
432+ LL | unsafe fn unsafe_comment() {}
433+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
434+ |
435+ help: consider changing the `safety` comment for a `# Safety` doc comment
436+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:780:8
437+ |
438+ LL | // SAFETY: Bla
439+ | ^^^^^^^
440+
441+ error: function has unnecessary safety comment
442+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:787:5
443+ |
444+ LL | unsafe fn unsafe_block_comment() {}
445+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
446+ |
447+ help: consider changing the `safety` comment for a `# Safety` doc comment
448+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:785:8
449+ |
450+ LL | SAFETY: Bla
451+ | ^^^^^^^
452+
453+ error: function has unnecessary safety comment
454+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:791:5
455+ |
456+ LL | fn safe_comment() {}
457+ | ^^^^^^^^^^^^^^^^^^^^
458+ |
459+ help: consider removing the safety comment
460+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:790:8
461+ |
462+ LL | // SAFETY: Bla
463+ | ^^^^^^^
464+
465+ error: function has unnecessary safety comment
466+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:795:5
467+ |
468+ LL | fn safe_doc_comment() {}
469+ | ^^^^^^^^^^^^^^^^^^^^^^^^
470+ |
471+ help: consider removing the safety comment
472+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:794:9
473+ |
474+ LL | /// SAFETY: Bla
475+ | ^^^^^^^
356476
357- error: aborting due to 40 previous errors
477+ error: aborting due to 50 previous errors
358478
0 commit comments