Unsafe

  • unsafe annotations in Rust are used to bypass protections put in place by the compiler

  • Specifically, there are four primary things that unsafe is used for

    • dereferencing raw pointers
    • calling functions or methods which are unsafe
    • accessing or modifying static mutable variables
    • implementing unsafe traits