Unsafe attributes support (unnecessary_safety_comment
) · Issue #13317 · rust-lang/rust-clippy (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
What it does
Unsafe attributes have been stabilized (rust-lang/rust#128771, rust-lang/rust#123757), thus it would be nice to have a lint that ensures // SAFETY
comments are not written for safe attributes.
Since unnecessary_safety_comment
covers impl
s too, perhaps it should also cover this too, although it may be best to possibly split them (but that is a different issue).
See #13316 as well.
Advantage
No response
Drawbacks
No response
Example
// SAFETY: ... #[derive(Debug)] struct S;
Should be written as:
#[derive(Debug)] struct S;