]> git.proxmox.com Git - rustc.git/blob - src/doc/reference/src/behavior-not-considered-unsafe.md
New upstream version 1.17.0+dfsg1
[rustc.git] / src / doc / reference / src / behavior-not-considered-unsafe.md
1 ## Behavior not considered unsafe
2
3 This is a list of behavior not considered *unsafe* in Rust terms, but that may
4 be undesired.
5
6 * Deadlocks
7 * Leaks of memory and other resources
8 * Exiting without calling destructors
9 * Integer overflow
10 - Overflow is considered "unexpected" behavior and is always user-error,
11 unless the `wrapping` primitives are used. In non-optimized builds, the compiler
12 will insert debug checks that panic on overflow, but in optimized builds overflow
13 instead results in wrapped values. See [RFC 560] for the rationale and more details.
14
15 [RFC 560]: https://github.com/rust-lang/rfcs/blob/master/text/0560-integer-overflow.md