diff --git a/core/src/bool.rs b/core/src/bool.rs index 03cdff9b13be1..58a870d2e0725 100644 --- a/core/src/bool.rs +++ b/core/src/bool.rs @@ -55,6 +55,7 @@ impl bool { /// assert_eq!(a, 1); /// ``` #[stable(feature = "lazy_bool_to_option", since = "1.50.0")] + #[cfg_attr(not(test), rustc_diagnostic_item = "bool_then")] #[inline] pub fn then T>(self, f: F) -> Option { if self { Some(f()) } else { None }