Björn Tantau@swg-empire.de to Programmer Humor@programming.dev · 2 days agoPretty straight forwardswg-empire.deimagemessage-square46fedilinkarrow-up1698arrow-down112file-text
arrow-up1686arrow-down1imagePretty straight forwardswg-empire.deBjörn Tantau@swg-empire.de to Programmer Humor@programming.dev · 2 days agomessage-square46fedilinkfile-text
minus-squarecalcopiritus@lemmy.worldlinkfedilinkarrow-up1·1 day 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.