11.4. Behavior not considered unsafe

Behavior not considered unsafe

This is a list of behavior not considered unsafe in Rust terms, but that may be undesired.

  • Deadlocks
  • Leaks of memory and other resources
  • Exiting without calling destructors
  • Integer overflow
    • Overflow is considered "unexpected" behavior and is always user-error, unless the wrapping primitives are used. In non-optimized builds, the compiler will insert debug checks that panic on overflow, but in optimized builds overflow instead results in wrapped values. See RFC 560 for the rationale and more details.

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/reference/behavior-not-considered-unsafe.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部