Nemeski@mander.xyz to Rust@programming.dev · 3 days agoSwitching to Rust's own mangling scheme on nightlyblog.rust-lang.orgexternal-linkmessage-square6fedilinkarrow-up139
arrow-up139external-linkSwitching to Rust's own mangling scheme on nightlyblog.rust-lang.orgNemeski@mander.xyz to Rust@programming.dev · 3 days agomessage-square6fedilink
minus-squareINeedMana@piefed.ziplinkfedilinkEnglisharrow-up1·2 days agoWouldn’t that make the body of the function unsafe too? I would recommend reading up some materials on FFI in Rust Yeah, I’m slowly getting to that
minus-squareTehPers@beehaw.orglinkfedilinkEnglisharrow-up2·2 days agoNo, the attribute is unsafe. An unsafe function is marked unsafe fn. Also, unsafe by itself just means there are invariants that must me manually upheld to avoid unsound behavior. If those invariants are upheld, then it doesn’t matter if it’s unsafe.
Wouldn’t that make the body of the function unsafe too?
Yeah, I’m slowly getting to that
No, the attribute is unsafe. An unsafe function is marked
unsafe fn.Also, unsafe by itself just means there are invariants that must me manually upheld to avoid unsound behavior. If those invariants are upheld, then it doesn’t matter if it’s unsafe.