Björn Tantau@swg-empire.de to Programmer Humor@programming.dev · 6 months agoPretty straight forwardswg-empire.deimagemessage-square45linkfedilinkarrow-up1655arrow-down110file-text
arrow-up1645arrow-down1imagePretty straight forwardswg-empire.deBjörn Tantau@swg-empire.de to Programmer Humor@programming.dev · 6 months agomessage-square45linkfedilinkfile-text
minus-squarecalcopiritus@lemmy.worldcakelinkfedilinkarrow-up1·6 months 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.
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.