about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-08-10 19:45:51 +1000
committerGitHub <noreply@github.com>2025-08-10 19:45:51 +1000
commitc15c2f0a428c97e26ffa90ea13a11eabddd28978 (patch)
tree1c5166beee7dd01f37bfb1524d95b0d3e8923b4d
parent7b3afa65540e13deb346d7a0b34b30bd43eec46b (diff)
parentb5e2ba67756896eb76322882cceb979625c0514b (diff)
downloadrust-c15c2f0a428c97e26ffa90ea13a11eabddd28978.tar.gz
rust-c15c2f0a428c97e26ffa90ea13a11eabddd28978.zip
Rollup merge of #145135 - Kivooeo:stabilize-duration_constructors_lite, r=ChrisDenton
Stabilize `duration_constructors_lite` feature

This closes [tracking issue](https://github.com/rust-lang/rust/issues/140881) and stabilises `Duration::from_hours` and `Duration::from_mins` while not touching a `duration_constructors` feature from the related [tracking issue (2)](https://github.com/rust-lang/rust/issues/120301)
-rw-r--r--library/core/src/time.rs8
-rw-r--r--library/coretests/tests/lib.rs1
-rw-r--r--src/doc/unstable-book/src/library-features/duration-constructors-lite.md11
-rw-r--r--src/doc/unstable-book/src/library-features/duration-constructors.md1
4 files changed, 4 insertions, 17 deletions
diff --git a/library/core/src/time.rs b/library/core/src/time.rs
index 0fb5c0bac75..9a0f5e0faef 100644
--- a/library/core/src/time.rs
+++ b/library/core/src/time.rs
@@ -373,7 +373,6 @@ impl Duration {
     /// # Examples
     ///
     /// ```
-    /// #![feature(duration_constructors_lite)]
     /// use std::time::Duration;
     ///
     /// let duration = Duration::from_hours(6);
@@ -381,7 +380,8 @@ impl Duration {
     /// assert_eq!(6 * 60 * 60, duration.as_secs());
     /// assert_eq!(0, duration.subsec_nanos());
     /// ```
-    #[unstable(feature = "duration_constructors_lite", issue = "140881")]
+    #[stable(feature = "duration_constructors_lite", since = "CURRENT_RUSTC_VERSION")]
+    #[rustc_const_stable(feature = "duration_constructors_lite", since = "CURRENT_RUSTC_VERSION")]
     #[must_use]
     #[inline]
     pub const fn from_hours(hours: u64) -> Duration {
@@ -401,7 +401,6 @@ impl Duration {
     /// # Examples
     ///
     /// ```
-    /// #![feature(duration_constructors_lite)]
     /// use std::time::Duration;
     ///
     /// let duration = Duration::from_mins(10);
@@ -409,7 +408,8 @@ impl Duration {
     /// assert_eq!(10 * 60, duration.as_secs());
     /// assert_eq!(0, duration.subsec_nanos());
     /// ```
-    #[unstable(feature = "duration_constructors_lite", issue = "140881")]
+    #[stable(feature = "duration_constructors_lite", since = "CURRENT_RUSTC_VERSION")]
+    #[rustc_const_stable(feature = "duration_constructors_lite", since = "CURRENT_RUSTC_VERSION")]
     #[must_use]
     #[inline]
     pub const fn from_mins(mins: u64) -> Duration {
diff --git a/library/coretests/tests/lib.rs b/library/coretests/tests/lib.rs
index 75679bbac91..0c4d49f3c99 100644
--- a/library/coretests/tests/lib.rs
+++ b/library/coretests/tests/lib.rs
@@ -36,7 +36,6 @@
 #![feature(drop_guard)]
 #![feature(duration_constants)]
 #![feature(duration_constructors)]
-#![feature(duration_constructors_lite)]
 #![feature(error_generic_member_access)]
 #![feature(exact_div)]
 #![feature(exact_size_is_empty)]
diff --git a/src/doc/unstable-book/src/library-features/duration-constructors-lite.md b/src/doc/unstable-book/src/library-features/duration-constructors-lite.md
deleted file mode 100644
index 5238b84f776..00000000000
--- a/src/doc/unstable-book/src/library-features/duration-constructors-lite.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# `duration_constructors_lite`
-
-The tracking issue for this feature is: [#140881]
-
-[#140881]: https://github.com/rust-lang/rust/issues/140881
-
-------------------------
-
-Add the methods `from_mins`, `from_hours` to `Duration`.
-
-For `from_days` and `from_weeks` see [`duration_constructors`](https://github.com/rust-lang/rust/issues/120301).
diff --git a/src/doc/unstable-book/src/library-features/duration-constructors.md b/src/doc/unstable-book/src/library-features/duration-constructors.md
index 49ad78d1961..2626e0500b5 100644
--- a/src/doc/unstable-book/src/library-features/duration-constructors.md
+++ b/src/doc/unstable-book/src/library-features/duration-constructors.md
@@ -7,4 +7,3 @@ The tracking issue for this feature is: [#120301]
 ------------------------
 
 Add the methods `from_days` and `from_weeks` to `Duration`.
-For `from_mins` and `from_hours` see [duration-constructors-lite.md](./duration-constructors-lite.md)