From: Ian Jackson Date: Sun, 15 May 2022 11:04:23 +0000 (+0100) Subject: Make InternalLogicError be Clone, with an Arc X-Git-Tag: otter-1.1.0~131 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d5ff7fb8089a8c393312327ab801fcf97641bc3f;p=otter.git Make InternalLogicError be Clone, with an Arc shapelib wants this for SubstErrors which ought to be Clone. Signed-off-by: Ian Jackson --- diff --git a/src/error.rs b/src/error.rs index 3b9554ea..c234a991 100644 --- a/src/error.rs +++ b/src/error.rs @@ -64,10 +64,10 @@ pub enum InternalError { #[error("Unsupported colour spec")] pub struct UnsupportedColourSpec; -#[derive(Error)] +#[derive(Error,Clone)] pub struct InternalLogicError { desc: Cow<'static, str>, - backtrace: parking_lot::Mutex, + backtrace: Arc>, } pub fn internal_error_bydebug(desc: &dyn Debug) -> IE { @@ -79,7 +79,7 @@ impl InternalLogicError { let backtrace = backtrace::Backtrace::new_unresolved(); InternalLogicError { desc: desc.into(), - backtrace: parking_lot::Mutex::new(backtrace), + backtrace: Arc::new(parking_lot::Mutex::new(backtrace)), } } }