Skip to content

add a Backtrace::disabled function #74490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add a Backtrace::disabled function
  • Loading branch information
yaahc committed Jul 18, 2020
commit 8561b67b6f263b6647f02d36e0824b6c54544bf0
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 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