From 4119bfcd3ad2d67754b59e272dadb4c3de01b03f Mon Sep 17 00:00:00 2001 From: mohanson Date: Wed, 27 Nov 2024 15:43:22 +0800 Subject: [PATCH] Add # Safety section to cast_ptr_to_slice_mut's doc --- definitions/src/asm.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/definitions/src/asm.rs b/definitions/src/asm.rs index 525874ea..858dd6fe 100644 --- a/definitions/src/asm.rs +++ b/definitions/src/asm.rs @@ -183,6 +183,10 @@ impl AsmCoreMachine { } /// Provides similar functionality to `cast_ptr_to_slice` but returns mut slice. + /// + /// # Safety + /// + /// Same as `cast_ptr_to_slice`. pub unsafe fn cast_ptr_to_slice_mut(&self, ptr: u64, offset: usize, size: usize) -> &mut [u8] { let ptr = ptr as *mut u8; let ptr = ptr.add(offset);