Expand description
This file implements “place projections”; basically a symmetric API for 3 types: MPlaceTy, OpTy, PlaceTy.
OpTy and PlaceTy generally work by “let’s see if we are actually an MPlaceTy, and do something custom if not”.
For PlaceTy, the custom thing is basically always to call force_allocation and then use the MPlaceTy logic anyway.
For OpTy, the custom thing on field projections has to be pretty clever (since Operand::Immediate can have fields),
but for array/slice operations it only has to worry about Operand::Uninit. That makes the value part trivial,
but we still need to do bounds checking and adjust the layout. To not duplicate that with MPlaceTy, we actually
implement the logic on OpTy, and MPlaceTy calls that.
Re-exports§
use std::marker::PhantomData;🔒use std::ops::Range;🔒use rustc_abi as abi;🔒use rustc_abi::FieldIdx;🔒use rustc_abi::Size;🔒use rustc_abi::VariantIdx;🔒use rustc_middle::ty::Ty;🔒use rustc_middle::ty::layout::TyAndLayout;🔒use rustc_middle::mir;🔒use rustc_middle::ty;🔒use rustc_span::Symbol;🔒use rustc_span::bug;🔒use rustc_span::span_bug;🔒use tracing::debug;🔒use tracing::instrument;🔒use tracing::instrument;🔒use super::InterpCx;🔒use super::InterpResult;🔒use super::MPlaceTy;🔒use super::Machine;🔒use super::MemPlaceMeta;🔒use super::OpTy;🔒use super::Provenance;🔒use super::Scalar;🔒use super::err_ub;🔒use super::interp_ok;🔒use super::throw_ub;🔒use super::throw_unsup;🔒
Structs§
- Array
Iterator - A type representing iteration over the elements of an array.
Enums§
- Offset
Mode - Describes the constraints placed on offset-projections.
Traits§
- Projectable
- A thing that we can project into, and that has a layout.