Extend clippy::missing_safety_doc to unsafe fields#16767
Conversation
|
Some changes occurred in clippy_lints/src/doc cc @notriddle |
|
rustbot has assigned @samueltardieu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
No changes for a5b2489 |
There was a problem hiding this comment.
Can you have a look at the result of lintcheck at https://github.com/rust-lang/rust-clippy/actions/runs/23604878022#user-content-unnecessary-safety-doc? I wonder whether we should signal UNNECESSARY_SAFETY_DOC on fields which are not frozen, such as UnsafeCell and things derived from it.
@rustbot author
|
That's perhaps a candidate for a field that should be marked More generally: struct Even {
// # Must be even
unsafe n: AtomicU8,
} |
|
Is there anything I can do to help get this merged? I'm at RustWeek if you'd like to chat! |
So maybe the lint could suggest that if the WDYT? |
|
Huh. Yeah, the current state of the PR is problematic. If I'll revise the lint to only fire if the |
|
Take a look and let me know what you think. The naming and diagnostics of |
|
LGTM! |
changelog: [
missing_safety_doc]: lint unsafe fieldsMakes progress towards rust-lang/rust#132922