We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 369e746 commit 71f1aefCopy full SHA for 71f1aef
src/lib.rs
@@ -285,6 +285,16 @@ pub trait ConstantTimeEq {
285
}
286
287
288
+/// A marker trait indicating that `Eq` equality testing uses `ConstantTimeEq` under the hood.
289
+///
290
+/// Even though `Eq`-based equality testing returns a `bool`, it's a common design pattern
291
+/// to have some types implement this using `ConstantTimeEq`, and then coerce the resulting
292
+/// `Choice` into a `bool`.
293
294
+/// This marker trait should be used if and only if you do this, in order to signal this
295
+/// functionality to implementers.
296
+pub trait EqIsConstantTimeEq {}
297
+
298
impl<T: ConstantTimeEq> ConstantTimeEq for [T] {
299
/// Check whether two slices of `ConstantTimeEq` types are equal.
300
///
0 commit comments