From f96a3214d6b9c898054aaf45d871e13068b0f838 Mon Sep 17 00:00:00 2001 From: Ole Bertram Date: Sat, 29 Jun 2024 20:39:13 +0200 Subject: [PATCH] Stabilize `duration_abs_diff` --- core/src/time.rs | 5 +++-- core/tests/lib.rs | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/time.rs b/core/src/time.rs index 73c556249bedf..d66f558078ea8 100644 --- a/core/src/time.rs +++ b/core/src/time.rs @@ -620,13 +620,14 @@ impl Duration { /// Basic usage: /// /// ``` - /// #![feature(duration_abs_diff)] /// use std::time::Duration; /// /// assert_eq!(Duration::new(100, 0).abs_diff(Duration::new(80, 0)), Duration::new(20, 0)); /// assert_eq!(Duration::new(100, 400_000_000).abs_diff(Duration::new(110, 0)), Duration::new(9, 600_000_000)); /// ``` - #[unstable(feature = "duration_abs_diff", issue = "117618")] + #[stable(feature = "duration_abs_diff", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "duration_abs_diff", since = "CURRENT_RUSTC_VERSION")] + #[rustc_allow_const_fn_unstable(const_option)] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] diff --git a/core/tests/lib.rs b/core/tests/lib.rs index 57127df51ebdd..83a615fcd8be3 100644 --- a/core/tests/lib.rs +++ b/core/tests/lib.rs @@ -30,7 +30,6 @@ #![feature(core_private_bignum)] #![feature(core_private_diy_float)] #![feature(dec2flt)] -#![feature(duration_abs_diff)] #![feature(duration_consts_float)] #![feature(duration_constants)] #![feature(duration_constructors)]