File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
tests/ui-toml/undocumented_unsafe_blocks Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -414,5 +414,17 @@ help: consider removing the safety comment
414414LL | // SAFETY: ...
415415 | ^^^^^^^^^^^^^^
416416
417- error: aborting due to 45 previous errors
417+ error: statement has unnecessary safety comment
418+ --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:773: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:771:9
425+ |
426+ LL | // SAFETY: ...
427+ | ^^^^^^^^^^^^^^
428+
429+ error: aborting due to 46 previous errors
418430
Original file line number Diff line number Diff line change @@ -751,7 +751,7 @@ mod issue_14555 {
751751 //~^ unnecessary_safety_comment
752752}
753753
754- mod issue_todo {
754+ mod issue_15754 {
755755 #[ must_use]
756756 // SAFETY: ...
757757 #[ doc( hidden) ]
@@ -765,6 +765,14 @@ mod issue_todo {
765765 unsafe { }
766766 //~[disabled]^ undocumented_unsafe_blocks
767767 }
768+
769+ fn bar ( ) {
770+ #[ doc( hidden) ]
771+ // SAFETY: ...
772+ #[ allow( clippy:: unnecessary_cast) ]
773+ let x = 34 ;
774+ //~[default]^ unnecessary_safety_comment
775+ }
768776}
769777
770778fn main ( ) { }
You can’t perform that action at this time.
0 commit comments