add a Backtrace::disabled function

This commit is contained in:
Jane Lusby 2020-07-18 15:51:44 -07:00
parent 1fa54ad968
commit 8561b67b6f

View file

@ -291,6 +291,12 @@ impl Backtrace {
Backtrace::create(Backtrace::force_capture as usize)
}
/// Forcibly captures a disabled backtrace, regardless of environment
/// variable configuration.
pub fn disabled() -> Backtrace {
Backtrace { inner: Inner::Disabled };
}
// Capture a backtrace which start just before the function addressed by
// `ip`
fn create(ip: usize) -> Backtrace {