[−][src]Trait rustc_mir::interpret::Machine
🔬 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
type MemoryData: Clone + Eq
🔬 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
type MemoryKinds: Debug + Copy + Clone + Eq
🔬 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
const MUT_STATIC_KIND: Option<Self::MemoryKinds>
🔬 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.
const DETECT_LOOPS: bool
🔬 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
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>>>
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>>>
🔬 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 dest
and ret
in the same Option
proved very annoying when only one of them
was used.
fn call_intrinsic<'a>(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
instance: Instance<'tcx>,
args: &[OpTy<'tcx>],
dest: PlaceTy<'tcx>
) -> EvalResult<'tcx>
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
instance: Instance<'tcx>,
args: &[OpTy<'tcx>],
dest: PlaceTy<'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?
Directly process an intrinsic without pushing a stack frame. If this returns successfully, the engine will take care of jumping to the next block.
fn find_foreign_static<'a>(
tcx: TyCtxtAt<'a, 'tcx, 'tcx>,
def_id: DefId
) -> EvalResult<'tcx, &'tcx Allocation>
tcx: TyCtxtAt<'a, 'tcx, 'tcx>,
def_id: DefId
) -> EvalResult<'tcx, &'tcx Allocation>
🔬 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.
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)>
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)>
🔬 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
fn box_alloc<'a>(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
dest: PlaceTy<'tcx>
) -> EvalResult<'tcx>
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
dest: PlaceTy<'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?
Heap allocations via the box
keyword
Returns a pointer to the allocated memory
Provided Methods
fn validation_op<'a>(
_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
_op: ValidationOp,
_operand: &ValidationOperand<'tcx, Place<'tcx>>
) -> EvalResult<'tcx>
_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?
Execute a validation operation
Implementors
impl<'mir, 'tcx> Machine<'mir, 'tcx> for CompileTimeEvaluator
[src]
impl<'mir, 'tcx> Machine<'mir, 'tcx> for CompileTimeEvaluator
type MemoryData = ()
🔬 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?
type MemoryKinds = !
🔬 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?
const MUT_STATIC_KIND: Option<!>
[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?
const DETECT_LOOPS: bool
[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?
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>>>
[src]
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>>>
🔬 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?
fn call_intrinsic<'a>(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
instance: Instance<'tcx>,
args: &[OpTy<'tcx>],
dest: PlaceTy<'tcx>
) -> EvalResult<'tcx>
[src]
fn call_intrinsic<'a>(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
instance: Instance<'tcx>,
args: &[OpTy<'tcx>],
dest: PlaceTy<'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?
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)>
[src]
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)>
🔬 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?
fn find_foreign_static<'a>(
_tcx: TyCtxtAt<'a, 'tcx, 'tcx>,
_def_id: DefId
) -> EvalResult<'tcx, &'tcx Allocation>
[src]
fn find_foreign_static<'a>(
_tcx: TyCtxtAt<'a, 'tcx, 'tcx>,
_def_id: DefId
) -> EvalResult<'tcx, &'tcx Allocation>
🔬 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?
fn box_alloc<'a>(
_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
_dest: PlaceTy<'tcx>
) -> EvalResult<'tcx>
[src]
fn box_alloc<'a>(
_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
_dest: PlaceTy<'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?
fn validation_op<'a>(
_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
_op: ValidationOp,
_operand: &ValidationOperand<'tcx, Place<'tcx>>
) -> EvalResult<'tcx>
[src]
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?