diff --git a/rust/src/disassembly.rs b/rust/src/disassembly.rs index 6825d7edd..688a5374f 100644 --- a/rust/src/disassembly.rs +++ b/rust/src/disassembly.rs @@ -282,14 +282,14 @@ unsafe impl CoreArrayProviderInner for InstructionTextToken { impl CoreArrayProvider for Array { type Raw = BNInstructionTextLine; type Context = (); - type Wrapped<'a> = Self; + type Wrapped<'a> = mem::ManuallyDrop; } unsafe impl CoreArrayProviderInner for Array { unsafe fn free(raw: *mut Self::Raw, count: usize, _context: &Self::Context) { BNFreeInstructionTextLines(raw, count) } unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { - Self::new(raw.tokens, raw.count, ()) + mem::ManuallyDrop::new(Self::new(raw.tokens, raw.count, ())) } }