Ensuring Rust Safety: Strategies for Managing Unsafe Rust
summary
Claims that you need unsafe in only about 99% of cases you do not, and recommends three concrete strategies: design for safety (example: a 128-variant enum represented as u8 with an unsafe from-byte constructor and a safe Option-returning wrapper), testing with Miri to catch UB from uninitialized/padding bytes (Miri runs on nightly and does not check across FFI), and proving with Kani (bounded harnesses, e.g. 32-byte bounds, ~40s runs). Also cites RFCs like unsafe fields and function contracts and a stdlib verification effort.
AI-written summary · about
chapters (9)
- 0:00Rust safety journey
- 1:26C++ to Rust safety
- 3:54Safe versus unsafe Rust
- 6:01Designing for safety
- 13:49Unsafe traits and type safety
- 16:40Testing with Miri
- 21:20Proving safety formally
- 26:37Future of unsafe Rust
- 29:28Summary








