Rust · Concept
unsafe
Rust uses unsafe for operations whose memory-safety rules the compiler cannot verify. Unsafe blocks show that the programmer has checked those rules.
Last updated
Syntax
unsafe { /* unsafe operation */ }
unsafe fn name() { /* ... */ }
unsafe trait Name { /* ... */ }
unsafe impl Name for Type { /* ... */ }In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
unsafe fnunsafe traitunsafe {}unsafe implunsafe_op_in_unsafe_fnraw pointersunion