Skip to content

Glossary: Rust in Practice

unsafe function

Also written: unsafe fn

A function with a rule its caller must keep that the compiler can't check, such as `get_unchecked` needing an index in range. Callers need an `unsafe` block.

Where the book teaches it

Related terms

unsafeSAFETY commentsafe wrapper