rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

`undocumented_unsafe_blocks` should attempt to detect typos

Open clarfonthey opened this issue 4 months ago • 3 comments

Description

Example:

// SAFTEY: Trust me.
let mut x = unsafe { x.unchecked_add(1) };

This just says that there isn't a SAFETY comment, but should probably notice that it typoed SAFETY as SAFTEY. Here are a few examples of what I think should be checked:

  • WORD : ...
  • WORD: ...
  • Word: ...

where the word in question is not SAFETY, and suggest to replace it with SAFETY.

Version

rustc 1.89.0-nightly (6ccd44760 2025-06-08)
binary: rustc
commit-hash: 6ccd4476036edfce364e6271f9e190ec7a2a1ff5
commit-date: 2025-06-08
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

Additional Labels

No response

clarfonthey avatar Jun 12 '25 17:06 clarfonthey