New lint (unnecessary_safety_comment): reverse of undocumented_unsafe_blocks · Issue #7954 · rust-lang/rust-clippy (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@ojeda

Description

@ojeda

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

Example

// SAFETY: x is Some. x.unwrap()

Could be written as: