Why does it require double casting

⚓ Rust    📅 2025-06-12    👤 surdeus    👁️ 5      

surdeus

Warning

This post was published 65 days ago. The information described in this article may have changed.

Guys, the code below compiles fine:
&mut errhp_ctl as *mut *mut OCIError as *mut *mut c_void
but this code errors:
&mut errhp_ctl as *mut *mut c_void

errhp is of type *mut OCIError.
What I don't understand here is why do I have to cast it twice, not just straight to the target type that is c_void?

1 post - 1 participant

Read full topic

🏷️ rust_feed