Skip to content

Glossary: Software Design Patterns in Rust

unsafe

Also written: unsafe code

A Rust keyword marking code the compiler can't fully check for safety. Changing a `static mut` needs it, so safer tools such as `OnceLock` or `Mutex` are used for shared global values instead.

Where the book teaches it

Related terms

staticMutex