-
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
New lint: Require # Safety
section in pub unsafe fn docs
#4535
Conversation
692fea2
to
6b6bdb8
Compare
Thanks for the review! r? @flip1995 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two NITs in the doc, then this should be ready to go
pub unsafe fn apocalypse(universe: &mut ()) { | ||
unimplemented!(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add a test that the lint doesn't trigger on non-async functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean an async function? How would that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah sorry, I meant adding a test for a non-unsafe function :D
Thanks again, @flip1995 |
Thanks! @bors r+ |
📌 Commit 38f252a has been approved by |
New lint: Require `# Safety` section in pub unsafe fn docs changelog: add `missing_safety_doc` lint This fixes #2207
💔 Test failed - checks-travis |
@bors rollup |
@bors r+ |
📌 Commit 70a7dab has been approved by |
New lint: Require `# Safety` section in pub unsafe fn docs changelog: add `missing_safety_doc` lint This fixes rust-lang#2207
Rollup of 4 pull requests Successful merges: - #4511 (New lint: mem_replace_with_uninit) - #4535 (New lint: Require `# Safety` section in pub unsafe fn docs) - #4539 (Changes cast-lossless to a pedantic lint) - #4544 (#4542 remove machine applicable suggestion) Failed merges: r? @ghost changelog: none
New lint: Require `# Safety` section in pub unsafe fn docs changelog: add `missing_safety_doc` lint This fixes #2207
☀️ Test successful - checks-travis, status-appveyor |
changelog: add
missing_safety_doc
lintThis fixes #2207