aboutsummaryrefslogtreecommitdiff
path: root/src/fmt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fmt.rs')
-rw-r--r--src/fmt.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/fmt.rs b/src/fmt.rs
index 03d8fd3..a99649b 100644
--- a/src/fmt.rs
+++ b/src/fmt.rs
@@ -5,10 +5,11 @@ use core::fmt::{self, Debug, Write};
impl ErrorImpl {
pub(crate) unsafe fn display(this: Ref<Self>, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "{}", Self::error(this))?;
+ write!(f, "{}", unsafe { Self::error(this) })?;
if f.alternate() {
- for cause in Self::chain(this).skip(1) {
+ let chain = unsafe { Self::chain(this) };
+ for cause in chain.skip(1) {
write!(f, ": {}", cause)?;
}
}
@@ -17,7 +18,7 @@ impl ErrorImpl {
}
pub(crate) unsafe fn debug(this: Ref<Self>, f: &mut fmt::Formatter) -> fmt::Result {
- let error = Self::error(this);
+ let error = unsafe { Self::error(this) };
if f.alternate() {
return Debug::fmt(error, f);
@@ -39,11 +40,11 @@ impl ErrorImpl {
}
}
- #[cfg(any(backtrace, feature = "backtrace"))]
+ #[cfg(any(std_backtrace, feature = "backtrace"))]
{
use crate::backtrace::BacktraceStatus;
- let backtrace = Self::backtrace(this);
+ let backtrace = unsafe { Self::backtrace(this) };
if let BacktraceStatus::Captured = backtrace.status() {
let mut backtrace = backtrace.to_string();
write!(f, "\n\n")?;