Skip to content

Commit

Permalink
Temporarily allow missing safety doc lint
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Burns <nico@nicoburns.com>
  • Loading branch information
nicoburns committed Dec 23, 2024
1 parent dd3e844 commit ac5f1c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions malloc_size_of/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ impl MallocSizeOfOps {

/// Call `size_of_op` on `ptr`, first checking that the allocation isn't
/// empty, because some types (such as `Vec`) utilize empty allocations.
#[allow(clippy::missing_safety_doc)]
pub unsafe fn malloc_size_of<T: ?Sized>(&self, ptr: *const T) -> usize {
if MallocSizeOfOps::is_empty(ptr) {
0
Expand All @@ -167,6 +168,7 @@ impl MallocSizeOfOps {

/// Call `enclosing_size_of_op`, which must be available, on `ptr`, which
/// must not be empty.
#[allow(clippy::missing_safety_doc)]
pub unsafe fn malloc_enclosing_size_of<T>(&self, ptr: *const T) -> usize {
assert!(!MallocSizeOfOps::is_empty(ptr));
(self.enclosing_size_of_op.unwrap())(ptr as *const c_void)
Expand Down

0 comments on commit ac5f1c2

Please sign in to comment.