1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-12-23 06:56:25 +02:00
Files
comprehensive-rust/src/unsafe-rust/unsafe-functions.md

20 lines
369 B
Markdown
Raw Normal View History

---
minutes: 15
---
# Unsafe Functions
A function or method can be marked `unsafe` if it has extra preconditions you
must uphold to avoid undefined behaviour.
There are two main categories:
- Rust functions declared unsafe with `unsafe fn`.
- Foreign functions in `extern "C"` blocks.
<details>
We will look at the two kinds of unsafe functions next.
</details>