Closed
Description
What it does
Warns about unexpected // SAFETY:
comments (i.e. the reverse of the undocumented_unsafe_blocks
lint).
This lint is similar to #6880, which is requesting the reverse of missing_safety_docs
.
Drawbacks
-
A project might also be using
// SAFETY:
comments to explain why safe code makes other unsafe code sound, e.g. within the module. -
Potential false positives in general (depending on how it is implemented).
Example
// SAFETY: `x` is `Some`.
x.unwrap()
Could be written as:
x.unwrap()