diff --git a/sol-diagnostic/src/lib.rs b/sol-diagnostic/src/lib.rs index 12907c4..49e2f86 100644 --- a/sol-diagnostic/src/lib.rs +++ b/sol-diagnostic/src/lib.rs @@ -45,20 +45,23 @@ impl IntoSolDiagnostic for Result { } } -#[derive(Clone, Debug)] -pub struct Diagnostic(pub Arc); +#[derive(Debug)] +pub struct Diagnostic(Box); impl Eq for Diagnostic {} impl From for Diagnostic { fn from(report: sol_eyre::Report) -> Self { - Self(Arc::new(report)) + Self(Box::new(report)) } } impl PartialEq for Diagnostic { fn eq(&self, other: &Diagnostic) -> bool { - Arc::ptr_eq(&self.0, &other.0) + let lhs: *const sol_eyre::Report = self.0.as_ref(); + let rhs: *const sol_eyre::Report = other.0.as_ref(); + + lhs == rhs && !lhs.is_null() } }