Feature gate: #![feature(panic_backtrace_config)]
This is a tracking issue for configuring the capture and display of backtraces in the default panic hook, as well as exposing that configuration to third-party libraries for usage.
Public APImod panic { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[non_exhaustive] pub enum BacktraceStyle { Short, Full, Off, } fn set_backtrace_style(BacktraceStyle); fn get_backtrace_style() -> Option<BacktraceStyle>; }
This API is intended to form part of the strategy for addressing the unsoundness of the std::env::set_var
API on some platforms (mostly non-Windows). See #92431 (comment) for a summary.
std::backtrace
?
std::panic::
prefix necessary to use these APIs, probably adding a second module to the mix isn't worth it.get_backtrace_style
be exposed?
Option<BacktraceStyle>
return type looks a little weird, and may not mean the intuitive thing -- None
represents Unsupported
, not "not set" or "don't print backtraces", as might be initially assumed.std::panic::report_backtrace(&mut dyn Write)
instead which internally knows how to format things.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4