File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
## Unreleased
9
9
10
10
### Changed
11
-
11
+ - Sealed the ` Diagnose ` trait.
12
12
- Implementation of the ` Default ` trait for ` Pointer ` now doesn't constrain the lifetime.
13
13
14
14
## [ 0.7.1] 2025-02-16
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ pub(crate) use diagnostic_url;
163
163
/// An extension trait for `Result<_, E>`, where `E` is an implementation of
164
164
/// [`Diagnostic`], that converts `E` into [`Report<E>`](`Report`), yielding
165
165
/// `Result<_, Report<E>>`.
166
- pub trait Diagnose < ' s , T > {
166
+ pub trait Diagnose < ' s , T > : private :: Sealed {
167
167
/// The error type returned from `diagnose` and `diagnose_with`.
168
168
type Error : Diagnostic ;
169
169
@@ -224,6 +224,11 @@ where
224
224
}
225
225
}
226
226
227
+ mod private {
228
+ pub trait Sealed { }
229
+ impl < T , E > Sealed for Result < T , E > { }
230
+ }
231
+
227
232
#[ cfg( test) ]
228
233
mod tests {
229
234
use super :: * ;
You can’t perform that action at this time.
0 commit comments