Open
Description
Description
Declaring an external function as safe
is a form of safety assertion, so it should be covered by undocumented_unsafe_blocks
and require a // SAFETY:
comment. (Or some kind of new group as that lint name is specific to blocks (containing #13316 too), but my expectation is that everyone enabling the existing lint actually wants the more general form).
I tried this code:
#![deny(clippy::undocumented_unsafe_blocks)]
unsafe extern "C" {
pub safe fn foo();
}
I expected to see this happen: something like the error: unsafe block missing a safety comment
message
Instead, this happened: no lint
Version
1.85.0-nightly (2024-12-03 c44b3d50fea96a3e0417)
Additional Labels
No response
Metadata
Metadata
Assignees
Labels
No labels