From 12b25dd6190a6626f79ed9f67bb0851fa5fe0303 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Fri, 17 Jan 2025 15:51:34 -0800 Subject: [PATCH] rust 1.80 ci fixes (#568) This fixes CI for rust 1.80. This effectively adds support for backtrace which came in rust 1.65 (MSRV is currently 1.70). --- src/error.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/error.rs b/src/error.rs index b9c5688c..b42296ba 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,6 +1,7 @@ //! Error types use std::{ + backtrace::Backtrace, fmt::{self, Debug, Display}, ops::Deref, }; @@ -59,7 +60,6 @@ where source: Option, /// Backtrace where error occurred - #[cfg(feature = "backtrace")] backtrace: Option, } @@ -72,8 +72,7 @@ where Context { kind, source, - #[cfg(feature = "backtrace")] - backtrace: Some(Backtrace::new()), + backtrace: Some(Backtrace::capture()), } } @@ -83,7 +82,6 @@ where } /// Get the backtrace associated with this error (if available) - #[cfg(feature = "backtrace")] pub fn backtrace(&self) -> Option<&Backtrace> { self.backtrace.as_ref() }