Skip to content

Commit 44c3a3e

Browse files
committed
ignore clippy warning about mut_from_ref for now
1 parent a78054f commit 44c3a3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

wasmtime-jni/src/ty/wasm_alloc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ impl WasmAlloc {
5050
}
5151

5252
/// Safety, the returned array is uninitialized
53+
#[allow(clippy::mut_from_ref)]
5354
pub unsafe fn as_mut(&self, wasm_slice: WasmSlice) -> &mut [u8] {
5455
debug!("data ptr: {}", wasm_slice.ptr);
5556

@@ -125,6 +126,7 @@ impl WasmAlloc {
125126
Ok(wasm_slice)
126127
}
127128

129+
#[allow(clippy::mut_from_ref)]
128130
pub unsafe fn obj_as_mut<T: Sized>(&self, ptr: i32) -> &mut T {
129131
debug_assert!(ptr > 0);
130132
let ptr_to_mem = self.memory.data_ptr().add(ptr as usize);
@@ -158,10 +160,12 @@ impl<'w> WasmSliceWrapper<'w> {
158160
}
159161

160162
/// Safety, the returned array is uninitialized
163+
#[allow(clippy::mut_from_ref)]
161164
pub unsafe fn as_mut(&self) -> &mut [u8] {
162165
self.wasm_alloc.as_mut(self.wasm_slice)
163166
}
164167

168+
#[allow(clippy::mut_from_ref)]
165169
pub unsafe fn obj_as_mut<T: Sized>(&self) -> &mut T {
166170
self.wasm_alloc.obj_as_mut(self.wasm_slice.ptr)
167171
}

0 commit comments

Comments
 (0)