Source: thenewstack.io

Unsafe Rust in the Wild
Rust is a systems programming language designed to have much stronger type safety than traditional systems languages such as C. More importantly, the safety guarantee is embedded in the language itself and checked at compile time. Before a Rust program can pass the compiler, common programming errors that plague traditional languages, such as uninitialized variables, dangling pointers, memory leaks and even data races, are mostly eliminated.

The purpose is to help demystify unsafe Rust and to provide answers to the most relevant questions about unsafe Rust, such as: How commonly is unsafe Rust used?

Rust has three kinds of unsafe code: unsafe function, unsafe block and unsafe traits.

Compared with unsafe blocks and unsafe functions, unsafe traits are much rarer.

Related Articles