Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4a92cf6

Browse files
committedOct 19, 2022
Derive Eq and Hash for ControlFlow
1 parent 46244f3 commit 4a92cf6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎library/core/src/ops/control_flow.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ use crate::{convert, ops};
7979
/// [`Break`]: ControlFlow::Break
8080
/// [`Continue`]: ControlFlow::Continue
8181
#[stable(feature = "control_flow_enum_type", since = "1.55.0")]
82-
#[derive(Debug, Clone, Copy, PartialEq)]
82+
// ControlFlow should not implement PartialOrd or Ord, per RFC 3058:
83+
// https://rust-lang.github.io/rfcs/3058-try-trait-v2.html#traits-for-controlflow
84+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
8385
pub enum ControlFlow<B, C = ()> {
8486
/// Move on to the next phase of the operation as normal.
8587
#[stable(feature = "control_flow_enum_type", since = "1.55.0")]

0 commit comments

Comments
 (0)
Please sign in to comment.