Working With Uninitialized Memory
All runtime-allocated memory in a Rust program begins its life asuninitialized. In this state the value of the memory is an indeterminate pileof bits that may or may not even reflect a valid state for the type that issupposed to inhabit that location of memory. Attempting to interpret this memoryas a value of any type will cause Undefined Behavior. Do Not Do This.
Rust provides mechanisms to work with uninitialized memory in checked (safe) andunchecked (unsafe) ways.
当前内容版权归 rust-lang.org 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 rust-lang.org .