File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,16 @@ pub trait ConstantTimeEq {
286
286
}
287
287
}
288
288
289
+ /// A marker trait indicating that `Eq` equality testing uses `ConstantTimeEq` under the hood.
290
+ ///
291
+ /// Even though `Eq`-based equality testing returns a `bool`, it's a common design pattern
292
+ /// to have some types implement this using `ConstantTimeEq`, and then coerce the resulting
293
+ /// `Choice` into a `bool`.
294
+ ///
295
+ /// This marker trait should be used if and only if you do this, in order to signal this
296
+ /// functionality to implementers.
297
+ pub trait EqIsConstantTimeEq { }
298
+
289
299
impl < T : ConstantTimeEq > ConstantTimeEq for [ T ] {
290
300
/// Check whether two slices of `ConstantTimeEq` types are equal.
291
301
///
You can’t perform that action at this time.
0 commit comments