about summary refs log tree commit diff
path: root/src/libstd/backtrace.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-07-23 08:56:45 +0000
committerbors <bors@rust-lang.org>2020-07-23 08:56:45 +0000
commit2bbfa02b1b15974d5772b520aa027bf79f8c248e (patch)
treee7e74cc74874cf154f4b5c5ea97cf04c132c982d /src/libstd/backtrace.rs
parentfcac11993ca055bbdc7683a2f6ed7b88a838fb0f (diff)
parent8f02f2c1abd6c3fbd3053da5bb6759a4698a949e (diff)
downloadrust-2bbfa02b1b15974d5772b520aa027bf79f8c248e.tar.gz
rust-2bbfa02b1b15974d5772b520aa027bf79f8c248e.zip
Auto merge of #74667 - Manishearth:rollup-s6k59sw, r=Manishearth
Rollup of 8 pull requests

Successful merges:

 - #74141 (libstd/libcore: fix various typos)
 - #74490 (add a Backtrace::disabled function)
 - #74548 (one more Path::with_extension example, to demonstrate behavior)
 - #74587 (Prefer constant over function)
 - #74606 (Remove Linux workarounds for missing CLOEXEC support)
 - #74637 (Make str point to primitive page)
 - #74654 (require type defaults to be after const generic parameters)
 - #74659 (Improve codegen for unchecked float casts on wasm)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libstd/backtrace.rs')
-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..09f83ea5fca 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 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 {