-
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
Rust API Guideline: Unsafe functions are documented with a "Safety" section #2207
Comments
I'm surprised that the Rust API Guidelines don't mention |
Unsafe blocks are not part of the API of a crate, so a recommendation like that is a bit out of scope for the API guidelines. It would be a good "restriction" category lint though. |
AFAIK, there's a rust PR to have tidy check this for the rust repo. But yes, it would be a good idea to check for this. |
I'll take this. |
New lint: Require `# Safety` section in pub unsafe fn docs changelog: add `missing_safety_doc` lint This fixes #2207
New lint: Require `# Safety` section in pub unsafe fn docs changelog: add `missing_safety_doc` lint This fixes rust-lang#2207
There should be a "Safety" section that explains all invariants that the caller is responsible for upholding to use the function correctly.
As per Function docs include error, panic, and safety considerations.
The text was updated successfully, but these errors were encountered: