diff --git a/CHANGELOG.md b/CHANGELOG.md index a270685..4c8ae11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased ### Changed - +- Sealed the `Diagnose` trait. - Implementation of the `Default` trait for `Pointer` now doesn't constrain the lifetime. ## [0.7.1] 2025-02-16 diff --git a/src/diagnostic.rs b/src/diagnostic.rs index 71d4643..d3e6943 100644 --- a/src/diagnostic.rs +++ b/src/diagnostic.rs @@ -163,7 +163,7 @@ pub(crate) use diagnostic_url; /// An extension trait for `Result<_, E>`, where `E` is an implementation of /// [`Diagnostic`], that converts `E` into [`Report`](`Report`), yielding /// `Result<_, Report>`. -pub trait Diagnose<'s, T> { +pub trait Diagnose<'s, T>: private::Sealed { /// The error type returned from `diagnose` and `diagnose_with`. type Error: Diagnostic; @@ -224,6 +224,11 @@ where } } +mod private { + pub trait Sealed {} + impl Sealed for Result {} +} + #[cfg(test)] mod tests { use super::*;