Closed
Description
With the following code:
/**
* Drop an external reference
*
* # Arguments
*
* - `id` : Reference ID
*
* # Safety
*
* Using the reference after it has been dropped is UB.
*/
pub unsafe fn drop_ext(&mut self, id: u32) {
self.extref.remove(&id);
}
I get this warning:
warning: unsafe function's docs miss `# Safety` section
--> src/nkgc.rs:779:5
|
779 | / pub unsafe fn drop_ext(&mut self, id: u32) {
780 | | self.extref.remove(&id);
781 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
This code does not result in a clippy warning:
///
/// Drop an external reference
///
/// # Arguments
///
/// - `id` : Reference ID
///
/// # Safety
///
/// Using the reference after it has been dropped is UB.
///
pub unsafe fn drop_ext(&mut self, id: u32) {
self.extref.remove(&id);
}
Given that /** ... */
-style doc-comments are supported by rustdoc, I would expect them to be supported by clippy as well.
Metadata
Metadata
Assignees
Labels
No labels