Skip to content

Glossary: Rust in Practice

SAFETY comment

Also written: // SAFETY:, # Safety

A `// SAFETY:` comment explains why an `unsafe` block's rule holds, and a `# Safety` doc section states the rule an `unsafe fn` needs its callers to keep.

Where the book teaches it

Related terms

unsafeunsafe function