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_lenient<'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>(
        &mut self,
        shim_sig: fn(&MiriInterpCx<'tcx>) -> ShimSig<'tcx, N>,
        link_name: Symbol,
        caller_fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
        caller_args: &'a [OpTy<'tcx>],
    ) -> InterpResult<'tcx, &'a [OpTy<'tcx>; N]> { ... }
    fn check_shim_sig_variadic_lenient<'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], &'a [OpTy<'tcx>])>
       where &'a [OpTy<'tcx>; N]: TryFrom<&'a [OpTy<'tcx>]> { ... }
    fn check_shim_sig_unadjusted<'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_lenient<'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]>

Source

fn check_shim_sig<'a, const N: usize>( &mut self, shim_sig: fn(&MiriInterpCx<'tcx>) -> ShimSig<'tcx, N>, link_name: Symbol, caller_fn_abi: &FnAbi<'tcx, Ty<'tcx>>, caller_args: &'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_lenient<'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], &'a [OpTy<'tcx>])>
where &'a [OpTy<'tcx>; N]: TryFrom<&'a [OpTy<'tcx>]>,

Check shim for variadic function. Returns a tuple that consisting of an array of fixed args, and a slice of varargs.

Source

fn check_shim_sig_unadjusted<'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 "unadjusted" 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>