[][src]Struct rustc_mir::interpret::InterpCx

pub struct InterpCx<'mir, 'tcx, M: Machine<'mir, 'tcx>> {
    pub machine: M,
    pub tcx: TyCtxtAt<'tcx>,
    pub(crate) param_env: ParamEnv<'tcx>,
    pub memory: Memory<'mir, 'tcx, M>,
    pub(super) vtables: FxHashMap<(Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>), Pointer<M::PointerTag>>,
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Fields

machine: M
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Stores the Machine instance.

Note: the stack is provided by the machine.

tcx: TyCtxtAt<'tcx>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

The results of the type checker, from rustc. The span in this is the "root" of the evaluation, i.e., the const we are evaluating (if this is CTFE).

param_env: ParamEnv<'tcx>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Bounds in scope for polymorphic evaluations.

memory: Memory<'mir, 'tcx, M>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

The virtual memory system.

vtables: FxHashMap<(Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>), Pointer<M::PointerTag>>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A cache for deduplicating vtables

Implementations

impl<'mir, 'tcx> InterpCx<'mir, 'tcx, CompileTimeInterpreter<'mir, 'tcx>>[src]

fn try_eval_const_fn_call(
    &mut self,
    instance: Instance<'tcx>,
    ret: Option<(PlaceTy<'tcx>, BasicBlock)>,
    args: &[OpTy<'tcx>]
) -> InterpResult<'tcx, bool>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Evaluate a const function where all arguments (if any) are zero-sized types. The evaluation is memoized thanks to the query system.

Returns true if the call has been evaluated.

fn hook_panic_fn(
    &mut self,
    instance: Instance<'tcx>,
    args: &[OpTy<'tcx>]
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

"Intercept" a function call to a panic-related function because we have something special to do for it. If this returns successfully (Ok), the function should just be evaluated normally.

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M>[src]

pub fn cast(
    &mut self,
    src: OpTy<'tcx, M::PointerTag>,
    cast_kind: CastKind,
    cast_ty: Ty<'tcx>,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn misc_cast(
    &self,
    src: ImmTy<'tcx, M::PointerTag>,
    cast_ty: Ty<'tcx>
) -> InterpResult<'tcx, Immediate<M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn cast_from_scalar(
    &self,
    v: u128,
    src_layout: TyAndLayout<'tcx>,
    cast_ty: Ty<'tcx>
) -> Scalar<M::PointerTag>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn cast_from_float<F>(&self, f: F, dest_ty: Ty<'tcx>) -> Scalar<M::PointerTag> where
    F: Float + Into<Scalar<M::PointerTag>> + FloatConvert<Single> + FloatConvert<Double>, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn unsize_into_ptr(
    &mut self,
    src: OpTy<'tcx, M::PointerTag>,
    dest: PlaceTy<'tcx, M::PointerTag>,
    source_ty: Ty<'tcx>,
    cast_ty: Ty<'tcx>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn unsize_into(
    &mut self,
    src: OpTy<'tcx, M::PointerTag>,
    cast_ty: TyAndLayout<'tcx>,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M>[src]

pub fn new(
    tcx: TyCtxt<'tcx>,
    root_span: Span,
    param_env: ParamEnv<'tcx>,
    machine: M,
    memory_extra: M::MemoryExtra
) -> Self
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn cur_span(&self) -> Span[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn force_ptr(
    &self,
    scalar: Scalar<M::PointerTag>
) -> InterpResult<'tcx, Pointer<M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn force_bits(
    &self,
    scalar: Scalar<M::PointerTag>,
    size: Size
) -> InterpResult<'tcx, u128>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn tag_global_base_pointer(&self, ptr: Pointer) -> Pointer<M::PointerTag>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Call this to turn untagged "global" pointers (obtained via tcx) into the canonical machine pointer to the allocation. Must never be used for any other pointers!

This represents a direct access to that memory, as opposed to access through a pointer that was created by the program.

pub(crate) fn stack(&self) -> &[Frame<'mir, 'tcx, M::PointerTag, M::FrameExtra>][src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(crate) fn stack_mut(
    &mut self
) -> &mut Vec<Frame<'mir, 'tcx, M::PointerTag, M::FrameExtra>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn frame_idx(&self) -> usize[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn frame(&self) -> &Frame<'mir, 'tcx, M::PointerTag, M::FrameExtra>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn frame_mut(
    &mut self
) -> &mut Frame<'mir, 'tcx, M::PointerTag, M::FrameExtra>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn body(
    &self
) -> &'mir Body<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn sign_extend(&self, value: u128, ty: TyAndLayout) -> u128[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn truncate(&self, value: u128, ty: TyAndLayout) -> u128[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn type_is_sized(&self, ty: Ty<'tcx>) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn type_is_freeze(&self, ty: Ty<'tcx>) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn load_mir(
    &self,
    instance: InstanceDef<'tcx>,
    promoted: Option<Promoted>
) -> InterpResult<'tcx, &'tcx Body<'tcx>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn subst_from_current_frame_and_normalize_erasing_regions<T: TypeFoldable<'tcx>>(
    &self,
    value: T
) -> T
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Call this on things you got out of the MIR (so it is as generic as the current stack frame), to bring it into the proper environment for this interpreter.

pub(super) fn subst_from_frame_and_normalize_erasing_regions<T: TypeFoldable<'tcx>>(
    &self,
    frame: &Frame<'mir, 'tcx, M::PointerTag, M::FrameExtra>,
    value: T
) -> T
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Call this on things you got out of the MIR (so it is as generic as the provided stack frame), to bring it into the proper environment for this interpreter.

pub(super) fn resolve(
    &self,
    def_id: DefId,
    substs: SubstsRef<'tcx>
) -> InterpResult<'tcx, Instance<'tcx>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

The substs are assumed to already be in our interpreter "universe" (param_env).

pub fn layout_of_local(
    &self,
    frame: &Frame<'mir, 'tcx, M::PointerTag, M::FrameExtra>,
    local: Local,
    layout: Option<TyAndLayout<'tcx>>
) -> InterpResult<'tcx, TyAndLayout<'tcx>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn size_and_align_of(
    &self,
    metadata: MemPlaceMeta<M::PointerTag>,
    layout: TyAndLayout<'tcx>
) -> InterpResult<'tcx, Option<(Size, Align)>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns the actual dynamic size and alignment of the place at the given type. Only the "meta" (metadata) part of the place matters. This can fail to provide an answer for extern types.

pub fn size_and_align_of_mplace(
    &self,
    mplace: MPlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, Option<(Size, Align)>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn push_stack_frame(
    &mut self,
    instance: Instance<'tcx>,
    body: &'mir Body<'tcx>,
    return_place: Option<PlaceTy<'tcx, M::PointerTag>>,
    return_to_block: StackPopCleanup
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn go_to_block(&mut self, target: BasicBlock)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Jump to the given block.

pub fn return_to_block(
    &mut self,
    target: Option<BasicBlock>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Return to the given target basic block. Do not use for unwinding! Use unwind_to_block instead.

If target is None, that indicates the function cannot return, so we raise UB.

pub fn unwind_to_block(&mut self, target: Option<BasicBlock>)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Unwind to the given target basic block. Do not use for returning! Use return_to_block instead.

If target is None, that indicates the function does not need cleanup during unwinding, and we will just keep propagating that upwards.

pub(super) fn pop_stack_frame(
    &mut self,
    unwinding: bool
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Pops the current frame from the stack, deallocating the memory for allocated locals.

If unwinding is false, then we are performing a normal return from a function. In this case, we jump back into the frame of the caller, and continue execution as normal.

If unwinding is true, then we are in the middle of a panic, and need to unwind this frame. In this case, we jump to the cleanup block for the function, which is responsible for running Drop impls for any locals that have been initialized at this point. The cleanup block ends with a special Resume terminator, which will cause us to continue unwinding.

pub fn storage_live(
    &mut self,
    local: Local
) -> InterpResult<'tcx, LocalValue<M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Mark a storage as live, killing the previous content and returning it. Remember to deallocate that!

pub fn storage_dead(&mut self, local: Local) -> LocalValue<M::PointerTag>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns the old value of the local. Remember to deallocate that!

pub(super) fn deallocate_local(
    &mut self,
    local: LocalValue<M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn const_eval(
    &self,
    gid: GlobalId<'tcx>,
    ty: Ty<'tcx>
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn const_eval_raw(
    &self,
    gid: GlobalId<'tcx>
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn dump_place(&self, place: Place<M::PointerTag>)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn generate_stacktrace(&self) -> Vec<FrameInfo<'tcx>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M>[src]

pub(crate) fn find_closest_untracked_caller_location(&self) -> Span[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Walks up the callstack from the intrinsic's callsite, searching for the first callsite in a frame which is not #[track_caller].

pub(crate) fn alloc_caller_location(
    &mut self,
    filename: Symbol,
    line: u32,
    col: u32
) -> MPlaceTy<'tcx, M::PointerTag>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Allocate a const core::panic::Location with the provided filename and line/column numbers.

pub(crate) fn location_triple_for_span(&self, span: Span) -> (Symbol, u32, u32)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn alloc_caller_location_for_span(
    &mut self,
    span: Span
) -> MPlaceTy<'tcx, M::PointerTag>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M>[src]

pub fn emulate_intrinsic(
    &mut self,
    instance: Instance<'tcx>,
    args: &[OpTy<'tcx, M::PointerTag>],
    ret: Option<(PlaceTy<'tcx, M::PointerTag>, BasicBlock)>
) -> InterpResult<'tcx, bool>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns true if emulation happened.

pub fn exact_div(
    &mut self,
    a: ImmTy<'tcx, M::PointerTag>,
    b: ImmTy<'tcx, M::PointerTag>,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn ptr_offset_inbounds(
    &self,
    ptr: Scalar<M::PointerTag>,
    pointee_ty: Ty<'tcx>,
    offset_count: i64
) -> InterpResult<'tcx, Scalar<M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Offsets a pointer by some multiple of its type, returning an error if the pointer leaves its allocation. For integer pointers, we consider each of them their own tiny allocation of size 0, so offset-by-0 (and only 0) is okay -- except that NULL cannot be offset by any value.

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M>[src]

pub fn force_op_ptr(
    &self,
    op: OpTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Normalice place.ptr to a Pointer if this is a place and not a ZST. Can be helpful to avoid lots of force_ptr calls later, if this place is used a lot.

fn try_read_immediate_from_mplace(
    &self,
    mplace: MPlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, Option<ImmTy<'tcx, M::PointerTag>>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Try reading an immediate in memory; this is interesting particularly for ScalarPair. Returns None if the layout does not permit loading this as a value.

pub(crate) fn try_read_immediate(
    &self,
    src: OpTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, Result<ImmTy<'tcx, M::PointerTag>, MPlaceTy<'tcx, M::PointerTag>>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Try returning an immediate for the operand. If the layout does not permit loading this as an immediate, return where in memory we can find the data. Note that for a given layout, this operation will either always fail or always succeed! Whether it succeeds depends on whether the layout can be represented in a Immediate, not on which data is stored there currently.

pub fn read_immediate(
    &self,
    op: OpTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, ImmTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Read an immediate from a place, asserting that that is possible with the given layout.

pub fn read_scalar(
    &self,
    op: OpTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, ScalarMaybeUninit<M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Read a scalar from a place

pub fn read_str(
    &self,
    mplace: MPlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, &str>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn operand_field(
    &self,
    op: OpTy<'tcx, M::PointerTag>,
    field: usize
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Projection functions

pub fn operand_index(
    &self,
    op: OpTy<'tcx, M::PointerTag>,
    index: u64
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn operand_downcast(
    &self,
    op: OpTy<'tcx, M::PointerTag>,
    variant: VariantIdx
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn operand_projection(
    &self,
    base: OpTy<'tcx, M::PointerTag>,
    proj_elem: PlaceElem<'tcx>
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn access_local(
    &self,
    frame: &Frame<'mir, 'tcx, M::PointerTag, M::FrameExtra>,
    local: Local,
    layout: Option<TyAndLayout<'tcx>>
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Read from a local. Will not actually access the local if reading from a ZST. Will not access memory, instead an indirect Operand is returned.

This is public because it is used by priroda to get an OpTy from a local

pub fn place_to_op(
    &self,
    place: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Every place can be read from, so we can turn them into an operand. This will definitely return Indirect if the place is a Ptr, i.e., this will never actually read from memory.

pub fn eval_place_to_op(
    &self,
    place: Place<'tcx>,
    layout: Option<TyAndLayout<'tcx>>
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn eval_operand(
    &self,
    mir_op: &Operand<'tcx>,
    layout: Option<TyAndLayout<'tcx>>
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Evaluate the operand, returning a place where you can then find the data. If you already know the layout, you can save two table lookups by passing it in here.

pub(super) fn eval_operands(
    &self,
    ops: &[Operand<'tcx>]
) -> InterpResult<'tcx, Vec<OpTy<'tcx, M::PointerTag>>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Evaluate a bunch of operands at once

pub(crate) fn eval_const_to_op(
    &self,
    val: &Const<'tcx>,
    layout: Option<TyAndLayout<'tcx>>
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

The val and layout are assumed to already be in our interpreter "universe" (param_env).

pub fn read_discriminant(
    &self,
    op: OpTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, (Scalar<M::PointerTag>, VariantIdx)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Read discriminant, return the runtime value as well as the variant index.

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M>[src]

pub fn binop_with_overflow(
    &mut self,
    op: BinOp,
    left: ImmTy<'tcx, M::PointerTag>,
    right: ImmTy<'tcx, M::PointerTag>,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Applies the binary operation op to the two operands and writes a tuple of the result and a boolean signifying the potential overflow to the destination.

pub fn binop_ignore_overflow(
    &mut self,
    op: BinOp,
    left: ImmTy<'tcx, M::PointerTag>,
    right: ImmTy<'tcx, M::PointerTag>,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Applies the binary operation op to the arguments and writes the result to the destination.

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M>[src]

fn binary_char_op(
    &self,
    bin_op: BinOp,
    l: char,
    r: char
) -> (Scalar<M::PointerTag>, bool, Ty<'tcx>)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn binary_bool_op(
    &self,
    bin_op: BinOp,
    l: bool,
    r: bool
) -> (Scalar<M::PointerTag>, bool, Ty<'tcx>)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn binary_float_op<F: Float + Into<Scalar<M::PointerTag>>>(
    &self,
    bin_op: BinOp,
    ty: Ty<'tcx>,
    l: F,
    r: F
) -> (Scalar<M::PointerTag>, bool, Ty<'tcx>)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn binary_int_op(
    &self,
    bin_op: BinOp,
    l: u128,
    left_layout: TyAndLayout<'tcx>,
    r: u128,
    right_layout: TyAndLayout<'tcx>
) -> InterpResult<'tcx, (Scalar<M::PointerTag>, bool, Ty<'tcx>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn overflowing_binary_op(
    &self,
    bin_op: BinOp,
    left: ImmTy<'tcx, M::PointerTag>,
    right: ImmTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, (Scalar<M::PointerTag>, bool, Ty<'tcx>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns the result of the specified operation, whether it overflowed, and the result type.

pub fn binary_op(
    &self,
    bin_op: BinOp,
    left: ImmTy<'tcx, M::PointerTag>,
    right: ImmTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, ImmTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Typed version of overflowing_binary_op, returning an ImmTy. Also ignores overflows.

pub fn overflowing_unary_op(
    &self,
    un_op: UnOp,
    val: ImmTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, (Scalar<M::PointerTag>, bool, Ty<'tcx>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns the result of the specified operation, whether it overflowed, and the result type.

pub fn unary_op(
    &self,
    un_op: UnOp,
    val: ImmTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, ImmTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'mir, 'tcx: 'mir, Tag, M> InterpCx<'mir, 'tcx, M> where
    Tag: Debug + Copy + Eq + Hash + 'static,
    M: Machine<'mir, 'tcx, PointerTag = Tag>,
    M::MemoryMap: AllocMap<AllocId, (MemoryKind<M::MemoryKind>, Allocation<Tag, M::AllocExtra>)>,
    M::AllocExtra: AllocationExtra<Tag>, 
[src]

pub fn ref_to_mplace(
    &self,
    val: ImmTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Take a value, which represents a (thin or wide) reference, and make it a place. Alignment is just based on the type. This is the inverse of MemPlace::to_ref().

Only call this if you are sure the place is "valid" (aligned and inbounds), or do not want to ever use the place for memory access! Generally prefer deref_operand.

pub fn deref_operand(
    &self,
    src: OpTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Take an operand, representing a pointer, and dereference it to a place -- that will always be a MemPlace. Lives in place.rs because it creates a place.

pub(super) fn check_mplace_access(
    &self,
    place: MPlaceTy<'tcx, M::PointerTag>,
    size: Option<Size>
) -> InterpResult<'tcx, Option<Pointer<M::PointerTag>>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Check if the given place is good for memory access with the given size, falling back to the layout's size if None (in the latter case, this must be a statically sized type).

On success, returns None for zero-sized accesses (where nothing else is left to do) and a Pointer to use for the actual access otherwise.

pub fn mplace_access_checked(
    &self,
    place: MPlaceTy<'tcx, M::PointerTag>,
    force_align: Option<Align>
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Return the "access-checked" version of this MPlace, where for non-ZST this is definitely a Pointer.

force_align must only be used when correct alignment does not matter, like in Stacked Borrows.

pub(super) fn force_mplace_ptr(
    &self,
    place: MPlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Force place.ptr to a Pointer. Can be helpful to avoid lots of force_ptr calls later, if this place is used a lot.

pub fn mplace_field(
    &self,
    base: MPlaceTy<'tcx, M::PointerTag>,
    field: usize
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Offset a pointer to project to a field of a struct/union. Unlike place_field, this is always possible without allocating, so it can take &self. Also return the field's layout. This supports both struct and array fields.

This also works for arrays, but then the usize index type is restricting. For indexing into arrays, use mplace_index.

pub fn mplace_index(
    &self,
    base: MPlaceTy<'tcx, M::PointerTag>,
    index: u64
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Index into an array.

pub(super) fn mplace_array_fields(
    &self,
    base: MPlaceTy<'tcx, Tag>
) -> InterpResult<'tcx, impl Iterator<Item = InterpResult<'tcx, MPlaceTy<'tcx, Tag>>> + 'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn mplace_subslice(
    &self,
    base: MPlaceTy<'tcx, M::PointerTag>,
    from: u64,
    to: u64,
    from_end: bool
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn mplace_downcast(
    &self,
    base: MPlaceTy<'tcx, M::PointerTag>,
    variant: VariantIdx
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn mplace_projection(
    &self,
    base: MPlaceTy<'tcx, M::PointerTag>,
    proj_elem: PlaceElem<'tcx>
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Project into an mplace

pub fn place_field(
    &mut self,
    base: PlaceTy<'tcx, M::PointerTag>,
    field: usize
) -> InterpResult<'tcx, PlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Gets the place of a field inside the place, and also the field's type. Just a convenience function, but used quite a bit. This is the only projection that might have a side-effect: We cannot project into the field of a local ScalarPair, we have to first allocate it.

pub fn place_index(
    &mut self,
    base: PlaceTy<'tcx, M::PointerTag>,
    index: u64
) -> InterpResult<'tcx, PlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn place_downcast(
    &self,
    base: PlaceTy<'tcx, M::PointerTag>,
    variant: VariantIdx
) -> InterpResult<'tcx, PlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn place_projection(
    &mut self,
    base: PlaceTy<'tcx, M::PointerTag>,
    proj_elem: &ProjectionElem<Local, Ty<'tcx>>
) -> InterpResult<'tcx, PlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Projects into a place.

pub fn eval_place(
    &mut self,
    place: Place<'tcx>
) -> InterpResult<'tcx, PlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Computes a place. You should only use this if you intend to write into this place; for reading, a more efficient alternative is eval_place_for_read.

pub fn write_scalar(
    &mut self,
    val: impl Into<ScalarMaybeUninit<M::PointerTag>>,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Write a scalar to a place

pub fn write_immediate(
    &mut self,
    src: Immediate<M::PointerTag>,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Write an immediate to a place

pub fn write_immediate_to_mplace(
    &mut self,
    src: Immediate<M::PointerTag>,
    dest: MPlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Write an Immediate to memory.

fn write_immediate_no_validate(
    &mut self,
    src: Immediate<M::PointerTag>,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Write an immediate to a place. If you use this you are responsible for validating that things got copied at the right type.

fn write_immediate_to_mplace_no_validate(
    &mut self,
    value: Immediate<M::PointerTag>,
    dest: MPlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Write an immediate to memory. If you use this you are responsible for validating that things got copied at the right type.

pub fn copy_op(
    &mut self,
    src: OpTy<'tcx, M::PointerTag>,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Copies the data from an operand to a place. This does not support transmuting! Use copy_op_transmute if the layouts could disagree.

fn copy_op_no_validate(
    &mut self,
    src: OpTy<'tcx, M::PointerTag>,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Copies the data from an operand to a place. This does not support transmuting! Use copy_op_transmute if the layouts could disagree. Also, if you use this you are responsible for validating that things get copied at the right type.

pub fn copy_op_transmute(
    &mut self,
    src: OpTy<'tcx, M::PointerTag>,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Copies the data from an operand to a place. The layouts may disagree, but they must have the same size.

pub fn force_allocation_maybe_sized(
    &mut self,
    place: PlaceTy<'tcx, M::PointerTag>,
    meta: MemPlaceMeta<M::PointerTag>
) -> InterpResult<'tcx, (MPlaceTy<'tcx, M::PointerTag>, Option<Size>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Ensures that a place is in memory, and returns where it is. If the place currently refers to a local that doesn't yet have a matching allocation, create such an allocation. This is essentially force_to_memplace.

This supports unsized types and returns the computed size to avoid some redundant computation when copying; use force_allocation for a simpler, sized-only version.

pub fn force_allocation(
    &mut self,
    place: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn allocate(
    &mut self,
    layout: TyAndLayout<'tcx>,
    kind: MemoryKind<M::MemoryKind>
) -> MPlaceTy<'tcx, M::PointerTag>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn allocate_str(
    &mut self,
    str: &str,
    kind: MemoryKind<M::MemoryKind>
) -> MPlaceTy<'tcx, M::PointerTag>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns a wide MPlace.

pub fn write_discriminant(
    &mut self,
    variant_index: VariantIdx,
    dest: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Writes the discriminant of the given variant.

pub fn raw_const_to_mplace(
    &self,
    raw: RawConst<'tcx>
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn unpack_dyn_trait(
    &self,
    mplace: MPlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx, (Instance<'tcx>, MPlaceTy<'tcx, M::PointerTag>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Turn a place with a dyn Trait type into a place with the actual dynamic type. Also return some more information so drop doesn't have to run the same code twice.

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M>[src]

pub fn run(&mut self) -> InterpResult<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn step(&mut self) -> InterpResult<'tcx, bool>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns true as long as there are more things to do.

This is used by priroda

This is marked #inline(always) to work around adverserial codegen when opt-level = 3

fn statement(&mut self, stmt: &Statement<'tcx>) -> InterpResult<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn eval_rvalue_into_place(
    &mut self,
    rvalue: &Rvalue<'tcx>,
    place: Place<'tcx>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Evaluate an assignment statement.

There is no separate eval_rvalue function. Instead, the code for handling each rvalue type writes its results directly into the memory specified by the place.

fn terminator(&mut self, terminator: &Terminator<'tcx>) -> InterpResult<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M>[src]

pub(super) fn eval_terminator(
    &mut self,
    terminator: &Terminator<'tcx>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn check_argument_compat(
    rust_abi: bool,
    caller: TyAndLayout<'tcx>,
    callee: TyAndLayout<'tcx>
) -> bool
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn pass_argument(
    &mut self,
    rust_abi: bool,
    caller_arg: &mut impl Iterator<Item = OpTy<'tcx, M::PointerTag>>,
    callee_arg: PlaceTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Pass a single argument, checking the types for compatibility.

fn eval_fn_call(
    &mut self,
    fn_val: FnVal<'tcx, M::ExtraFnVal>,
    caller_abi: Abi,
    args: &[OpTy<'tcx, M::PointerTag>],
    ret: Option<(PlaceTy<'tcx, M::PointerTag>, BasicBlock)>,
    unwind: Option<BasicBlock>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Call this function -- pushing the stack frame and initializing the arguments.

fn drop_in_place(
    &mut self,
    place: PlaceTy<'tcx, M::PointerTag>,
    instance: Instance<'tcx>,
    target: BasicBlock,
    unwind: Option<BasicBlock>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M>[src]

pub fn get_vtable(
    &mut self,
    ty: Ty<'tcx>,
    poly_trait_ref: Option<PolyExistentialTraitRef<'tcx>>
) -> InterpResult<'tcx, Pointer<M::PointerTag>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Creates a dynamic vtable for the given type and vtable origin. This is used only for objects.

The trait_ref encodes the erased self type. Hence, if we are making an object Foo<Trait> from a value of type Foo<T>, then trait_ref would map T: Trait.

pub fn get_vtable_slot(
    &self,
    vtable: Scalar<M::PointerTag>,
    idx: u64
) -> InterpResult<'tcx, FnVal<'tcx, M::ExtraFnVal>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Resolves the function at the specified slot in the provided vtable. An index of '0' corresponds to the first method declared in the trait of the provided vtable.

pub fn read_drop_type_from_vtable(
    &self,
    vtable: Scalar<M::PointerTag>
) -> InterpResult<'tcx, (Instance<'tcx>, Ty<'tcx>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns the drop fn instance as well as the actual dynamic type.

pub fn read_size_and_align_from_vtable(
    &self,
    vtable: Scalar<M::PointerTag>
) -> InterpResult<'tcx, (Size, Align)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M>[src]

fn validate_operand_internal(
    &self,
    op: OpTy<'tcx, M::PointerTag>,
    path: Vec<PathElem>,
    ref_tracking_for_consts: Option<&mut RefTracking<MPlaceTy<'tcx, M::PointerTag>, Vec<PathElem>>>,
    may_ref_to_static: bool
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn const_validate_operand(
    &self,
    op: OpTy<'tcx, M::PointerTag>,
    path: Vec<PathElem>,
    ref_tracking: &mut RefTracking<MPlaceTy<'tcx, M::PointerTag>, Vec<PathElem>>,
    may_ref_to_static: bool
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

This function checks the data at op to be const-valid. op is assumed to cover valid memory if it is an indirect operand. It will error if the bits at the destination do not match the ones described by the layout.

ref_tracking is used to record references that we encounter so that they can be checked recursively by an outside driving loop.

may_ref_to_static controls whether references are allowed to point to statics.

pub fn validate_operand(
    &self,
    op: OpTy<'tcx, M::PointerTag>
) -> InterpResult<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

This function checks the data at op to be runtime-valid. op is assumed to cover valid memory if it is an indirect operand. It will error if the bits at the destination do not match the ones described by the layout.

Trait Implementations

impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> HasDataLayout for InterpCx<'mir, 'tcx, M>[src]

impl<'mir, 'tcx, M> HasParamEnv<'tcx> for InterpCx<'mir, 'tcx, M> where
    M: Machine<'mir, 'tcx>, 
[src]

impl<'mir, 'tcx, M> HasTyCtxt<'tcx> for InterpCx<'mir, 'tcx, M> where
    M: Machine<'mir, 'tcx>, 
[src]

impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> LayoutOf for InterpCx<'mir, 'tcx, M>[src]

type Ty = Ty<'tcx>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type TyAndLayout = InterpResult<'tcx, TyAndLayout<'tcx>>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Auto Trait Implementations

impl<'mir, 'tcx, M> !RefUnwindSafe for InterpCx<'mir, 'tcx, M>

impl<'mir, 'tcx, M> !Send for InterpCx<'mir, 'tcx, M>

impl<'mir, 'tcx, M> !Sync for InterpCx<'mir, 'tcx, M>

impl<'mir, 'tcx, M> Unpin for InterpCx<'mir, 'tcx, M> where
    M: Unpin,
    <M as Machine<'mir, 'tcx>>::ExtraFnVal: Unpin,
    <M as Machine<'mir, 'tcx>>::MemoryExtra: Unpin,
    <M as Machine<'mir, 'tcx>>::MemoryMap: Unpin,
    <M as Machine<'mir, 'tcx>>::PointerTag: Unpin

impl<'mir, 'tcx, M> !UnwindSafe for InterpCx<'mir, 'tcx, M>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> Cast for T

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeResult<T> for T[src]

type Error = !

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<T> PointerArithmetic for T where
    T: HasDataLayout
[src]

impl<T> Same<T> for T

type Output = T

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Should always be Self

impl<E> SpecializationError for E[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]