Memory-safe C code
Memory-safe C code
Posted Nov 17, 2025 8:29 UTC (Mon) by hunger (subscriber, #36242)In reply to: Memory-safe C code by alx.manpages
Parent article: Rust in Android: move fast and fix things (Google Security Blog)
Any code the rust compiler can not proof to follow all its internal rules needs to be marked `unsafe`. It does not matter whether that is because the code does something tricky that is too complex for the rust compiler to make sense of -- or whether it is just written in some language the rust compiler can not reason about. So *all* non-rust code is by definition `unsafe` in rust, there is no way around that.
`unsafe` is IMHO a needlessly inflammatory name for a marker that basically says "The rust compiler does not fully understand this code", especially when you are communication with other language communities. I guess we are stuck with that name now though :-/
