···5959 } else {
6060 // Safety: Ensure that the pointer is valid for $len elements,
6161 // and that the memory was allocated in a way that is compatible with Rust's Vec.
6262- unsafe { Vec::from_raw_parts($ptr, $len, $len) }
6262+ unsafe { Vec::from_raw_parts($ptr as *mut i8, $len, $len) }
6363 }
6464 }};
6565}