miri/shims/native_lib/trace/
stub.rs

1use rustc_const_eval::interpret::InterpResult;
2
3static SUPERVISOR: std::sync::Mutex<()> = std::sync::Mutex::new(());
4
5pub struct Supervisor;
6
7#[derive(Debug)]
8pub struct SvInitError;
9
10impl Supervisor {
11    #[inline(always)]
12    pub fn is_enabled() -> bool {
13        false
14    }
15
16    pub fn do_ffi<'tcx, T>(
17        _: T,
18        f: impl FnOnce() -> InterpResult<'tcx, crate::ImmTy<'tcx>>,
19    ) -> InterpResult<'tcx, (crate::ImmTy<'tcx>, Option<super::MemEvents>)> {
20        // We acquire the lock to ensure that no two FFI calls run concurrently.
21        let _g = SUPERVISOR.lock().unwrap();
22        f().map(|v| (v, None))
23    }
24}
25
26#[inline(always)]
27#[allow(dead_code, clippy::missing_safety_doc)]
28pub unsafe fn init_sv() -> Result<!, SvInitError> {
29    Err(SvInitError)
30}
31
32#[inline(always)]
33#[allow(dead_code)]
34pub fn register_retcode_sv<T>(_: T) {}