From c1a4a69d65ac2de087f60a306f698625dc7632b0 Mon Sep 17 00:00:00 2001 From: GnomedDev Date: Wed, 18 Sep 2024 22:08:04 +0100 Subject: [PATCH] [Clippy] Swap `instant_subtraction` to use diagnostic item instead of path --- std/src/time.rs | 1 + 1 file changed, 1 insertion(+) 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()) }