about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJane Lusby <jlusby@yaah.dev>2020-07-18 15:51:44 -0700
committerJane Lusby <jlusby@yaah.dev>2020-07-18 15:51:44 -0700
commit8561b67b6f263b6647f02d36e0824b6c54544bf0 (patch)
treec31b03456d0b1daeaf7c375eb703ebd84cf777cf
parent1fa54ad9680cc82e7301f8ed4e9b7402dfd6ce0e (diff)
downloadrust-8561b67b6f263b6647f02d36e0824b6c54544bf0.tar.gz
rust-8561b67b6f263b6647f02d36e0824b6c54544bf0.zip
add a Backtrace::disabled function
-rw-r--r--src/libstd/backtrace.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/backtrace.rs b/src/libstd/backtrace.rs
index e65775c1ced..28acec79de0 100644
--- a/src/libstd/backtrace.rs
+++ b/src/libstd/backtrace.rs
@@ -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 {