safety contract
The conditions a caller must guarantee before calling an unsafe function.
An unsafe fn documents its preconditions in a # Safety section; each unsafe block states in a // SAFETY: comment why those conditions hold at that call.
Examples
A
/// # Safetydoc section sayingimust be less thanstacks.len()is the contract; Clippy'smissing_safety_docflags apub unsafe fnwithout one.
See also