Skip to content

Commit

Permalink
Rollup merge of #74490 - yaahc:disabled-bt, r=dtolnay
Browse files Browse the repository at this point in the history
add a Backtrace::disabled function

Based upon @dtolnay's suggestion here: dtolnay/anyhow#97 (comment)
  • Loading branch information
Manishearth authored Jul 23, 2020
2 parents 9be1099 + 50347b8 commit f98c77c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libstd/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ impl Backtrace {
Backtrace::create(Backtrace::force_capture as usize)
}

/// Forcibly captures a disabled backtrace, regardless of environment
/// variable configuration.
pub const fn disabled() -> Backtrace {
Backtrace { inner: Inner::Disabled }
}

// Capture a backtrace which start just before the function addressed by
// `ip`
fn create(ip: usize) -> Backtrace {
Expand Down

0 comments on commit f98c77c

Please sign in to comment.