Skip to content

Commit

Permalink
Add diagnostic item for std::ops::ControlFlow
Browse files Browse the repository at this point in the history
This will be used in Clippy to detect useless conversions done through
`ControlFlow::map_break()` and `ControlFlow::map_continue()`.
  • Loading branch information
samueltardieu authored and gitbot committed Feb 20, 2025
1 parent 5f4a51c commit a513619
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/src/ops/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ use crate::{convert, ops};
/// [`Break`]: ControlFlow::Break
/// [`Continue`]: ControlFlow::Continue
#[stable(feature = "control_flow_enum_type", since = "1.55.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "ControlFlow")]
// ControlFlow should not implement PartialOrd or Ord, per RFC 3058:
// https://rust-lang.github.io/rfcs/3058-try-trait-v2.html#traits-for-controlflow
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
Expand Down

0 comments on commit a513619

Please sign in to comment.