Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

不安全

不安全操作是那些可能违反 Rust 静态语义的内存安全保证的操作。

以下语言级功能不能在 Rust 的安全子集中使用:

  • 访问 union 的字段,赋值除外。
  • 调用不安全函数。

  1. 在 2024 版本之前,允许声明不带 unsafe 的 extern 块。