Explore the intricacies of unsafe code in Rust through this 30-minute conference talk by Jon Gjengset at Rust NYC. Delve into the complexities of unsafe code, understanding its necessity, potential dangers, and responsible usage. Learn about working with hardware, external code, and concurrency primitives. Discover performance optimization techniques and the risks associated with unsafe practices. Examine real-world examples like "Playing Russian Roulette" and "Lazy Drop Offset of Macro" to grasp the integrity of unsafe code. Gain valuable insights into internal unsafe code implementation and how to navigate this powerful yet potentially hazardous aspect of Rust programming.
Overview
Syllabus
Introduction
Why we need unsafe
Working with hardware
Working with external code
Working with concurrency primitives
Performance optimization
Unsafe can go wrong
Playing Russian Roulette
Lazy Drop
Offset of Macro
Integrity of unsafe code
Internal unsafe code
Taught by
Rust