diff options
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/disassembly.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rust/src/disassembly.rs b/rust/src/disassembly.rs index e3766f32..5d3da31e 100644 --- a/rust/src/disassembly.rs +++ b/rust/src/disassembly.rs @@ -272,28 +272,28 @@ impl Drop for InstructionTextToken { impl CoreArrayProvider for InstructionTextToken { type Raw = BNInstructionTextToken; type Context = (); - type Wrapped<'a> = Self; + type Wrapped<'a> = &'a Self; } unsafe impl CoreArrayProviderInner for InstructionTextToken { unsafe fn free(raw: *mut Self::Raw, count: usize, _context: &Self::Context) { BNFreeInstructionText(raw, count) } unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { - Self(*raw) + core::mem::transmute(raw) } } impl CoreArrayProvider for Array<InstructionTextToken> { type Raw = BNInstructionTextLine; type Context = (); - type Wrapped<'a> = Self; + type Wrapped<'a> = mem::ManuallyDrop<Self>; } unsafe impl CoreArrayProviderInner for Array<InstructionTextToken> { 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, ())) } } |
