std: move FULL_BACKTRACE_DEFAULT to sys::backtrace

This commit is contained in:
joboet 2025-12-12 20:29:44 +01:00
parent aa73de400d
commit 854df94584
No known key found for this signature in database
GPG key ID: 704E0149B0194B3C
3 changed files with 7 additions and 7 deletions

View file

@ -523,7 +523,7 @@ pub fn get_backtrace_style() -> Option<BacktraceStyle> {
Some(x) if &x == "0" => BacktraceStyle::Off,
Some(x) if &x == "full" => BacktraceStyle::Full,
Some(_) => BacktraceStyle::Short,
None if crate::sys::FULL_BACKTRACE_DEFAULT => BacktraceStyle::Full,
None if crate::sys::backtrace::FULL_BACKTRACE_DEFAULT => BacktraceStyle::Full,
None => BacktraceStyle::Off,
};

View file

@ -11,6 +11,12 @@ use crate::{env, fmt, io};
/// Max number of frames to print.
const MAX_NB_FRAMES: usize = 100;
pub(crate) const FULL_BACKTRACE_DEFAULT: bool = cfg_select! {
// Fuchsia components default to full backtrace.
target_os = "fuchsia" => true,
_ => false,
};
pub(crate) struct BacktraceLock<'a>(#[allow(dead_code)] MutexGuard<'a, ()>);
pub(crate) fn lock<'a>() -> BacktraceLock<'a> {

View file

@ -86,9 +86,3 @@ cfg_select! {
pub use self::unsupported::*;
}
}
pub const FULL_BACKTRACE_DEFAULT: bool = cfg_select! {
// Fuchsia components default to full backtrace.
target_os = "fuchsia" => true,
_ => false,
};