Skip to content

Commit 83f12d4

Browse files
samueltardieugitbot
authored and
gitbot
committed
Add diagnostic item for std::ops::ControlFlow
This will be used in Clippy to detect useless conversions done through `ControlFlow::map_break()` and `ControlFlow::map_continue()`.
1 parent 276aa30 commit 83f12d4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/ops/control_flow.rs

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ use crate::{convert, ops};
7979
/// [`Break`]: ControlFlow::Break
8080
/// [`Continue`]: ControlFlow::Continue
8181
#[stable(feature = "control_flow_enum_type", since = "1.55.0")]
82+
#[cfg_attr(not(test), rustc_diagnostic_item = "ControlFlow")]
8283
// ControlFlow should not implement PartialOrd or Ord, per RFC 3058:
8384
// https://rust-lang.github.io/rfcs/3058-try-trait-v2.html#traits-for-controlflow
8485
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]

0 commit comments

Comments
 (0)