Trait rustc_mir::interpret::Machine[][src]

pub trait Machine<'mir, 'tcx>: Sized {
    type MemoryData;
    type MemoryKinds: Debug + PartialEq + Copy + Clone;
    fn eval_fn_call<'a>(
        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
        instance: Instance<'tcx>,
        destination: Option<(Place, BasicBlock)>,
        args: &[ValTy<'tcx>],
        span: Span,
        sig: FnSig<'tcx>
    ) -> EvalResult<'tcx, bool>;
fn call_intrinsic<'a>(
        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
        instance: Instance<'tcx>,
        args: &[ValTy<'tcx>],
        dest: Place,
        dest_layout: TyLayout<'tcx>,
        target: BasicBlock
    ) -> EvalResult<'tcx>;
fn try_ptr_op<'a>(
        ecx: &EvalContext<'a, 'mir, 'tcx, Self>,
        bin_op: BinOp,
        left: PrimVal,
        left_ty: Ty<'tcx>,
        right: PrimVal,
        right_ty: Ty<'tcx>
    ) -> EvalResult<'tcx, Option<(PrimVal, bool)>>;
fn mark_static_initialized<'a>(
        _mem: &mut Memory<'a, 'mir, 'tcx, Self>,
        _id: AllocId,
        _mutability: Mutability
    ) -> EvalResult<'tcx, bool>;
fn init_static<'a>(
        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
        cid: GlobalId<'tcx>
    ) -> EvalResult<'tcx, AllocId>;
fn box_alloc<'a>(
        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
        ty: Ty<'tcx>,
        dest: Place
    ) -> EvalResult<'tcx>;
fn global_item_with_linkage<'a>(
        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
        instance: Instance<'tcx>,
        mutability: Mutability
    ) -> EvalResult<'tcx>; fn check_locks<'a>(
        _mem: &Memory<'a, 'mir, 'tcx, Self>,
        _ptr: MemoryPointer,
        _size: u64,
        _access: AccessKind
    ) -> EvalResult<'tcx> { ... }
fn add_lock<'a>(_mem: &mut Memory<'a, 'mir, 'tcx, Self>, _id: AllocId) { ... }
fn free_lock<'a>(
        _mem: &mut Memory<'a, 'mir, 'tcx, Self>,
        _id: AllocId,
        _len: u64
    ) -> EvalResult<'tcx> { ... }
fn end_region<'a>(
        _ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
        _reg: Option<Scope>
    ) -> EvalResult<'tcx> { ... }
fn validation_op<'a>(
        _ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
        _op: ValidationOp,
        _operand: &ValidationOperand<'tcx, Place<'tcx>>
    ) -> EvalResult<'tcx> { ... } }
🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Methods of this trait signifies a point where CTFE evaluation would fail and some use case dependent behaviour can instead be applied

Associated Types

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Additional data that can be accessed via the Memory

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Additional memory kinds a machine wishes to distinguish from the builtin ones

Required Methods

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Entry point to all function calls.

Returns Ok(true) when the function was handled completely e.g. due to missing mir

Returns Ok(false) if a new stack frame was pushed

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

directly process an intrinsic without pushing a stack frame.

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Called for all binary operations except on float types.

Returns None if the operation should be handled by the integer op code in order to share more code between machines

Returns a (value, overflowed) pair if the operation succeeded

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Called when trying to mark machine defined MemoryKinds as static

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Called when requiring a pointer to a static. Non const eval can create a mutable memory location for static mut

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Heap allocations via the box keyword

Returns a pointer to the allocated memory

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Called when trying to access a global declared with a linkage attribute

Provided Methods

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Implementors