std/backtrace/src/backtrace/
noop.rs

1//! Empty implementation of unwinding used when no other implementation is
2//! appropriate.
3
4use core::ffi::c_void;
5use core::ptr::null_mut;
6
7// SAFETY: This function is safe to call. It is only marked as `unsafe` to
8// avoid having to allow `unused_unsafe` since other implementations are
9// unsafe.
10#[inline(always)]
11pub unsafe fn trace(_cb: &mut dyn FnMut(&super::Frame) -> bool) {}
12
13#[derive(Clone)]
14pub struct Frame;
15
16impl Frame {
17    pub fn ip(&self) -> *mut c_void {
18        null_mut()
19    }
20
21    pub fn sp(&self) -> *mut c_void {
22        null_mut()
23    }
24
25    pub fn symbol_address(&self) -> *mut c_void {
26        null_mut()
27    }
28
29    pub fn module_base_address(&self) -> Option<*mut c_void> {
30        None
31    }
32}