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 @@ -285,6 +285,16 @@ pub trait ConstantTimeEq {
285285 }
286286}
287287
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+
288298impl < T : ConstantTimeEq > ConstantTimeEq for [ T ] {
289299 /// Check whether two slices of `ConstantTimeEq` types are equal.
290300 ///
You can’t perform that action at this time.
0 commit comments