rust-lang / rust-lang/rust-clippy

`undocumented_unsafe_blocks` should attempt to detect typos

Open
#15,038 5 comments 1 reaction 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.