]> git.proxmox.com Git - rustc.git/blob - src/doc/nomicon/src/uninitialized.md
New upstream version 1.17.0+dfsg1
[rustc.git] / src / doc / nomicon / src / uninitialized.md
1 # Working With Uninitialized Memory
2
3 All runtime-allocated memory in a Rust program begins its life as
4 *uninitialized*. In this state the value of the memory is an indeterminate pile
5 of bits that may or may not even reflect a valid state for the type that is
6 supposed to inhabit that location of memory. Attempting to interpret this memory
7 as a value of *any* type will cause Undefined Behavior. Do Not Do This.
8
9 Rust provides mechanisms to work with uninitialized memory in checked (safe) and
10 unchecked (unsafe) ways.