Add undocumented_unsafe_blocks lint by Serial-ATA · Pull Request #7748 · rust-lang/rust-clippy

flip1995

ShadowJonathan

flip1995

@Serial-ATA Serial-ATA changed the title Add undocumented_unsafe_block_safety lint Add undocumented_unsafe_blocks lint

Oct 4, 2021

flip1995

@flip1995 flip1995 added S-waiting-on-author

Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties

labels

Oct 5, 2021

Serial-ATA

flip1995

@Serial-ATA

@bors bors mentioned this pull request

Oct 8, 2021

@ojeda ojeda mentioned this pull request

Nov 25, 2021

71 tasks

@ghost ghost mentioned this pull request

Dec 17, 2021

bors added a commit that referenced this pull request

Dec 20, 2021
Fix `SAFETY` comment tag casing in undocumented_unsafe_blocks

This changes the lint introduced in #7748 to suggest adding a `SAFETY` comment instead of a `Safety` comment.

Searching for `// Safety:` in rust-lang/rust yields 67 results while `// SAFETY:` yields 1072.
I think it's safe to say that this comment tag is written in upper case, just like `TODO`, `FIXME` and so on are. As such I would expect this lint to follow the official convention as well.

Note that I intentionally introduced some casing diversity in `tests/ui/undocumented_unsafe_blocks.rs` to test more cases than just `Safety:`.

changelog: Capitalize `SAFETY` comment in [`undocumented_unsafe_blocks`]