rust-lang / rust-lang/rust-clippy
`undocumented_unsafe_blocks` should attempt to detect typos
Open
Nobody has claimed this yet.
C-enhancement
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation and tests for the undocumented_unsafe_blocks lint. Trace how comments are checked, then cover misspelled or differently cased SAFETY-style labels and verify that the suggestion replaces the label with SAFETY without changing unrelated comments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100