you are viewing a single comment's thread
view the rest of the comments
[–] 1 point 11 months ago (1 child)

Wouldn'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

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 11 months ago

    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.

  • source
  • parent