minus-squarecalcopiritus@lemmy.worldtoProgrammer Humor@programming.dev•Pretty straight forwardlinkfedilinkarrow-up1·2 days agounsafe fn<'a, T>(p: &'a T) -> &'static mut T { p as *cons T as *mut T as &'static mut T } It is a bit more than just dereferencing raw pointers. linkfedilink
unsafe fn<'a, T>(p: &'a T) -> &'static mut T { p as *cons T as *mut T as &'static mut T }
It is a bit more than just dereferencing raw pointers.