3 ms·
If you're asking about gtk-rs, yes you use it just like a library. The only reason the unsafe block is there is because it does FFI. The Rust compiler inherentl
by leshow 9y ago
If you're asking about gtk-rs, yes you use it just like a library. The only reason the unsafe block is there is because it does FFI. The Rust compiler inherently doesn't trust ffi calls. That doesn't mean necessarily that the call is actually unsafe.
- alphaalpha101 9y agoIf you write code that can be called without 'unsafe' then you are required to make that code safe. Whether you implement it using unsafe underneath is irrelevant. The unsafe block is there because it does FFI, which hasn't actually been verified to be safe.
- leshow 9y agoYou're rephrasing exactly what I said: > The Rust compiler inherently doesn't trust ffi calls. That doesn't mean necessarily that the call is actually unsafe.