Skip to content

Commit

Permalink
Rollup merge of #108798 - devsnek:panic-pal-exception, r=workingjubilee
Browse files Browse the repository at this point in the history
move default backtrace setting to sys

another PAL exception. moves the default backtrace setting to sys.
  • Loading branch information
Dylan-DPC authored Mar 19, 2023
2 parents c9754f3 + 8ad105a commit 5864082
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions std/src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,7 @@ pub fn get_backtrace_style() -> Option<BacktraceStyle> {
BacktraceStyle::Short
}
})
.unwrap_or(if cfg!(target_os = "fuchsia") {
// Fuchsia components default to full backtrace.
.unwrap_or(if crate::sys::FULL_BACKTRACE_DEFAULT {
BacktraceStyle::Full
} else {
BacktraceStyle::Off
Expand Down
9 changes: 9 additions & 0 deletions std/src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,12 @@ cfg_if::cfg_if! {
pub mod c;
}
}

cfg_if::cfg_if! {
// Fuchsia components default to full backtrace.
if #[cfg(target_os = "fuchsia")] {
pub const FULL_BACKTRACE_DEFAULT: bool = true;
} else {
pub const FULL_BACKTRACE_DEFAULT: bool = false;
}
}

0 comments on commit 5864082

Please sign in to comment.