Skip to content

Commit f8a1bf9

Browse files
committed
std: move FULL_BACKTRACE_DEFAULT to sys::backtrace
1 parent 9bd1c8b commit f8a1bf9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

library/std/src/panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ pub fn get_backtrace_style() -> Option<BacktraceStyle> {
523523
Some(x) if &x == "0" => BacktraceStyle::Off,
524524
Some(x) if &x == "full" => BacktraceStyle::Full,
525525
Some(_) => BacktraceStyle::Short,
526-
None if crate::sys::FULL_BACKTRACE_DEFAULT => BacktraceStyle::Full,
526+
None if crate::sys::backtrace::FULL_BACKTRACE_DEFAULT => BacktraceStyle::Full,
527527
None => BacktraceStyle::Off,
528528
};
529529

library/std/src/sys/backtrace.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ use crate::{env, fmt, io};
1111
/// Max number of frames to print.
1212
const MAX_NB_FRAMES: usize = 100;
1313

14+
pub(crate) const FULL_BACKTRACE_DEFAULT: bool = cfg_select! {
15+
// Fuchsia components default to full backtrace.
16+
target_os = "fuchsia" => true,
17+
_ => false,
18+
};
19+
1420
pub(crate) struct BacktraceLock<'a>(#[allow(dead_code)] MutexGuard<'a, ()>);
1521

1622
pub(crate) fn lock<'a>() -> BacktraceLock<'a> {

library/std/src/sys/pal/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,3 @@ cfg_select! {
8686
pub use self::unsupported::*;
8787
}
8888
}
89-
90-
pub const FULL_BACKTRACE_DEFAULT: bool = cfg_select! {
91-
// Fuchsia components default to full backtrace.
92-
target_os = "fuchsia" => true,
93-
_ => false,
94-
};

0 commit comments

Comments
 (0)