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

pub trait Machine<'mir, 'tcx>: Clone + Eq {
    type MemoryData: Clone + Eq;
    type MemoryKinds: Debug + Copy + Clone + Eq;

    const MUT_STATIC_KIND: Option<Self::MemoryKinds>;
    const DETECT_LOOPS: bool;

    fn find_fn<'a>(
        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
        instance: Instance<'tcx>,
        args: &[OpTy<'tcx>],
        dest: Option<PlaceTy<'tcx>>,
        ret: Option<BasicBlock>
    ) -> EvalResult<'tcx, Option<&'mir Mir<'tcx>>>;
fn call_intrinsic<'a>(
        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
        instance: Instance<'tcx>,
        args: &[OpTy<'tcx>],
        dest: PlaceTy<'tcx>
    ) -> EvalResult<'tcx>;
fn find_foreign_static<'a>(
        tcx: TyCtxtAt<'a, 'tcx, 'tcx>,
        def_id: DefId
    ) -> EvalResult<'tcx, &'tcx Allocation>;
fn ptr_op<'a>(
        ecx: &EvalContext<'a, 'mir, 'tcx, Self>,
        bin_op: BinOp,
        left: Scalar,
        left_layout: TyLayout<'tcx>,
        right: Scalar,
        right_layout: TyLayout<'tcx>
    ) -> EvalResult<'tcx, (Scalar, bool)>;
fn box_alloc<'a>(
        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
        dest: PlaceTy<'tcx>
    ) -> 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

Associated Constants

🔬 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?

The memory kind to use for mutated statics -- or None if those are not supported.

🔬 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?

Whether to attempt to detect infinite loops (any kind of infinite execution, really).

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 either the mir to use for the call, or None if execution should just proceed (which usually means this hook did all the work that the called function should usually have done). In the latter case, it is this hook's responsibility to call goto_block(ret) to advance the instruction pointer! (This is to support functions like __rust_maybe_catch_panic that neither find a MIR nor just jump to ret, but instead push their own stack frame.) Passing destand ret in the same Option proved very annoying when only one of them was used.

🔬 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. If this returns successfully, the engine will take care of jumping to the next block.

🔬 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 read access to a foreign static item. This can be called multiple times for the same static item and should return consistent results. Once the item is written the first time, as usual for statics a copy is made and this function is not called again.

🔬 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 on integer(-like) types when one operand is a pointer value, and for the Offset operation that is inherently about pointers.

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?

Heap allocations via the box keyword

Returns a pointer to the allocated memory

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?

Execute a validation operation

Implementors

impl<'mir, 'tcx> Machine<'mir, 'tcx> for CompileTimeEvaluator
[src]

🔬 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?

🔬 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?