-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unsafe extern { safe fn }
support
#13777
Comments
If I understand you correctly, this issue is not a duplicate of #13560, since it's about functions labelled unsafe extern "C" {
// SAFETY: ...
pub safe fn foo();
} However, in this case, I would not include it in But focusing on #13316 and #13317 ask for requiring proper safety documentation for attributes, while #13560 asks for safety documentation for
I think this should be addressed first before implementing the suggested lint. |
All But it is true that we may want to consider particular handling of individual items, especially for |
Description
Declaring an external function as
safe
is a form of safety assertion, so it should be covered byundocumented_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:
I expected to see this happen: something like the
error: unsafe block missing a safety comment
messageInstead, this happened: no lint
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: