3 ms·
> Safe Rust, Unsafe Rust These two are the exact same language. Some features (like calling unsafe functions, or dereferencing raw pointers) are "locked" outsi
by cesarb 4y ago
> Safe Rust, Unsafe Rust
These two are the exact same language. Some features (like calling unsafe functions, or dereferencing raw pointers) are "locked" outside unsafe blocks, but syntactically and semantically they are identical. It's easy to show this: put a unsafe block around a normal "safe" block, and all that happens is an extra "this does not need to be an unsafe block" warning from the compiler.
- woodruffw 4y agoMy other responses say this in more detail, but: they're not the exact same language if they have separate semantics and syntaxes, which they do. The fact that they can be composed together (much like C and the C preprocessor) does not make them the same language; it just makes them compatible.