Skip to main content

EvalContextExt

Trait EvalContextExt 

Source
pub trait EvalContextExt<'tcx>: MiriInterpCxExt<'tcx> {
    // Provided methods
    fn check_shim_symbol_clash(
        &self,
        link_name: Symbol,
    ) -> InterpResult<'tcx, ()> { ... }
    fn check_shim_sig_deprecated<'a, const N: usize>(
        &mut self,
        abi: &FnAbi<'tcx, Ty<'tcx>>,
        exp_abi: CanonAbi,
        link_name: Symbol,
        args: &'a [OpTy<'tcx>],
    ) -> InterpResult<'tcx, &'a [OpTy<'tcx>; N]> { ... }
    fn check_shim_sig<'a, const N: usize>(
        &self,
        shim_sig: fn(&MiriInterpCx<'tcx>) -> ShimSig<'tcx, N>,
        (link_name, caller_fn_abi, caller_args): (Symbol, &FnAbi<'tcx, Ty<'tcx>>, &'a [OpTy<'tcx>]),
    ) -> InterpResult<'tcx, &'a [OpTy<'tcx>; N]> { ... }
    fn check_shim_sig_variadic<'a, const N: usize>(
        &self,
        shim_sig: fn(&MiriInterpCx<'tcx>) -> ShimSig<'tcx, N>,
        (link_name, caller_fn_abi, caller_args): (Symbol, &FnAbi<'tcx, Ty<'tcx>>, &'a [OpTy<'tcx>]),
    ) -> InterpResult<'tcx, (&'a [OpTy<'tcx>; N], Varargs<'tcx, 'a>)> { ... }
    fn check_varargs<'a, const N: usize>(
        &self,
        tys: fn(&MiriInterpCx<'tcx>) -> [Ty<'tcx>; N],
        varargs: Varargs<'tcx, 'a>,
        fn_name: &str,
    ) -> InterpResult<'tcx, (&'a [OpTy<'tcx>; N], Varargs<'tcx, 'a>)> { ... }
    fn check_shim_sig_llvm_intrinsic<'a, const N: usize>(
        &mut self,
        link_name: Symbol,
        args: &'a [OpTy<'tcx>],
    ) -> InterpResult<'tcx, &'a [OpTy<'tcx>; N]> { ... }
}

Provided Methods§

Source

fn check_shim_symbol_clash(&self, link_name: Symbol) -> InterpResult<'tcx, ()>

Ensure the given symbol is not exported by the program.

Source

fn check_shim_sig_deprecated<'a, const N: usize>( &mut self, abi: &FnAbi<'tcx, Ty<'tcx>>, exp_abi: CanonAbi, link_name: Symbol, args: &'a [OpTy<'tcx>], ) -> InterpResult<'tcx, &'a [OpTy<'tcx>; N]>

‘Lenient’ signature check. Deprecated; use check_shim_sig instead.

Source

fn check_shim_sig<'a, const N: usize>( &self, shim_sig: fn(&MiriInterpCx<'tcx>) -> ShimSig<'tcx, N>, (link_name, caller_fn_abi, caller_args): (Symbol, &FnAbi<'tcx, Ty<'tcx>>, &'a [OpTy<'tcx>]), ) -> InterpResult<'tcx, &'a [OpTy<'tcx>; N]>

Check that the given caller_fn_abi matches the expected ABI described by shim_sig, and then returns the list of arguments.

Source

fn check_shim_sig_variadic<'a, const N: usize>( &self, shim_sig: fn(&MiriInterpCx<'tcx>) -> ShimSig<'tcx, N>, (link_name, caller_fn_abi, caller_args): (Symbol, &FnAbi<'tcx, Ty<'tcx>>, &'a [OpTy<'tcx>]), ) -> InterpResult<'tcx, (&'a [OpTy<'tcx>; N], Varargs<'tcx, 'a>)>

Check that the given caller_fn_abi matches the expected ABI described by shim_sig, and then returns the list of fixed and variadic arguments in separate lists.

Source

fn check_varargs<'a, const N: usize>( &self, tys: fn(&MiriInterpCx<'tcx>) -> [Ty<'tcx>; N], varargs: Varargs<'tcx, 'a>, fn_name: &str, ) -> InterpResult<'tcx, (&'a [OpTy<'tcx>; N], Varargs<'tcx, 'a>)>

Fetches N arguments from varargs, checking their types. Also returns the remaining varargs.

Source

fn check_shim_sig_llvm_intrinsic<'a, const N: usize>( &mut self, link_name: Symbol, args: &'a [OpTy<'tcx>], ) -> InterpResult<'tcx, &'a [OpTy<'tcx>; N]>

Check that the given function has the expected amount of arguments, and then return the list of arguments.

This may only be used for extern "llvm-intrinsic" LLVM intrinsics.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>