diff --git a/std/src/time.rs b/std/src/time.rs index ae46670c25e61..f28a0568a3c3d 100644 --- a/std/src/time.rs +++ b/std/src/time.rs @@ -280,6 +280,7 @@ impl Instant { /// ``` #[must_use] #[stable(feature = "time2", since = "1.8.0")] + #[cfg_attr(not(test), rustc_diagnostic_item = "instant_now")] pub fn now() -> Instant { Instant(time::Instant::now()) }