Skip to content

Commit 8561b67

Browse files
committed
add a Backtrace::disabled function
1 parent 1fa54ad commit 8561b67

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libstd/backtrace.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ impl Backtrace {
291291
Backtrace::create(Backtrace::force_capture as usize)
292292
}
293293

294+
/// Forcibly captures a disabled backtrace, regardless of environment
295+
/// variable configuration.
296+
pub fn disabled() -> Backtrace {
297+
Backtrace { inner: Inner::Disabled };
298+
}
299+
294300
// Capture a backtrace which start just before the function addressed by
295301
// `ip`
296302
fn create(ip: usize) -> Backtrace {

0 commit comments

Comments
 (0)