Expand description
The memory subsystem.
Generally, we use Pointer to denote memory addresses. However, some operations
have a βsizeβ-like parameter, and they take Scalar for the address because
if the size is 0, then the pointer can also be a (properly aligned, non-null)
integer. It is crucial that these operations call check_align before
short-circuiting the empty case!
Re-exportsΒ§
use std::borrow::Borrow;πuse std::borrow::Cow;πuse std::cell::Cell;πuse std::collections::VecDeque;πuse std::assert_matches;πuse std::fmt;πuse std::ptr;πuse rustc_abi::Align;πuse rustc_abi::HasDataLayout;πuse rustc_abi::Size;πuse rustc_ast::Mutability;πuse rustc_data_structures::fx::FxHashSet;πuse rustc_data_structures::fx::FxIndexMap;πuse rustc_middle::mir::display_allocation;πuse rustc_middle::ty;πuse rustc_middle::ty::Instance;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyCtxt;πuse rustc_span::bug;πuse tracing::debug;πuse tracing::instrument;πuse tracing::instrument;πuse tracing::trace;πuse super::AllocBytes;πuse super::AllocId;πuse super::AllocInit;πuse super::AllocMap;πuse super::AllocRange;πuse super::Allocation;πuse super::CheckAlignMsg;πuse super::CheckInAllocMsg;πuse super::CtfeProvenance;πuse super::GlobalAlloc;πuse super::InterpCx;πuse super::InterpResult;πuse super::MPlaceTy;πuse super::Machine;πuse super::MayLeak;πuse super::Misalignment;πuse super::Pointer;πuse super::PointerArithmetic;πuse super::Provenance;πuse super::Scalar;πuse super::alloc_range;πuse super::err_ub;πuse super::err_ub_format;πuse super::interp_ok;πuse super::throw_ub;πuse super::throw_ub_format;πuse super::throw_unsup;πuse super::throw_unsup_format;πuse crate::const_eval::ConstEvalErrKind;π
StructsΒ§
- Alloc
Info - Metadata about an
AllocId. - Alloc
Ref - A reference to some allocation that was already bounds-checked for the given region and had the on-access machine hooks run.
- Alloc
RefMut - A reference to some allocation that was already bounds-checked for the given region and had the on-access machine hooks run.
- Memory
EnumsΒ§
- Alloc
Kind - The return value of
get_alloc_infoindicates the βkindβ of the allocation. - FnVal
- The value of a function pointer.
- Memory
Kind