3 ms·
> The unsafe in `unsafe mod ffi { ... }` is literally the proof that all APIs exposed in the block are sound to call from safe Rust. I think there might be a m
by eximius 6y ago
> The unsafe in `unsafe mod ffi { ... }` is literally the proof that all APIs exposed in the block are sound to call from safe Rust.
I think there might be a misunderstanding here. I interpreted the `unsafe mod ffi { ... }` to be like `unsafe fn foo()`, declaring the module as unsafe, not an unsafe block where we're telling the compiler we will maintain the invariants ourselves.
It is somewhat unfortunate both the proof obligation and proof 'declaration' use the same token.
- fluffything 6y ago> It is somewhat unfortunate both the proof obligation and proof 'declaration' use the same token. There have been some RFCs open to improve this situation (e.g. unsafe blocks in unsafe functions comes to mind).