Skip to content

Commit c15c2f0

Browse files
authored
Rollup merge of rust-lang#145135 - Kivooeo:stabilize-duration_constructors_lite, r=ChrisDenton
Stabilize `duration_constructors_lite` feature This closes [tracking issue](rust-lang#140881) and stabilises `Duration::from_hours` and `Duration::from_mins` while not touching a `duration_constructors` feature from the related [tracking issue (2)](rust-lang#120301)
2 parents 7b3afa6 + b5e2ba6 commit c15c2f0

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

library/core/src/time.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,15 @@ impl Duration {
373373
/// # Examples
374374
///
375375
/// ```
376-
/// #![feature(duration_constructors_lite)]
377376
/// use std::time::Duration;
378377
///
379378
/// let duration = Duration::from_hours(6);
380379
///
381380
/// assert_eq!(6 * 60 * 60, duration.as_secs());
382381
/// assert_eq!(0, duration.subsec_nanos());
383382
/// ```
384-
#[unstable(feature = "duration_constructors_lite", issue = "140881")]
383+
#[stable(feature = "duration_constructors_lite", since = "CURRENT_RUSTC_VERSION")]
384+
#[rustc_const_stable(feature = "duration_constructors_lite", since = "CURRENT_RUSTC_VERSION")]
385385
#[must_use]
386386
#[inline]
387387
pub const fn from_hours(hours: u64) -> Duration {
@@ -401,15 +401,15 @@ impl Duration {
401401
/// # Examples
402402
///
403403
/// ```
404-
/// #![feature(duration_constructors_lite)]
405404
/// use std::time::Duration;
406405
///
407406
/// let duration = Duration::from_mins(10);
408407
///
409408
/// assert_eq!(10 * 60, duration.as_secs());
410409
/// assert_eq!(0, duration.subsec_nanos());
411410
/// ```
412-
#[unstable(feature = "duration_constructors_lite", issue = "140881")]
411+
#[stable(feature = "duration_constructors_lite", since = "CURRENT_RUSTC_VERSION")]
412+
#[rustc_const_stable(feature = "duration_constructors_lite", since = "CURRENT_RUSTC_VERSION")]
413413
#[must_use]
414414
#[inline]
415415
pub const fn from_mins(mins: u64) -> Duration {

library/coretests/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#![feature(drop_guard)]
3737
#![feature(duration_constants)]
3838
#![feature(duration_constructors)]
39-
#![feature(duration_constructors_lite)]
4039
#![feature(error_generic_member_access)]
4140
#![feature(exact_div)]
4241
#![feature(exact_size_is_empty)]

src/doc/unstable-book/src/library-features/duration-constructors-lite.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/doc/unstable-book/src/library-features/duration-constructors.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ The tracking issue for this feature is: [#120301]
77
------------------------
88

99
Add the methods `from_days` and `from_weeks` to `Duration`.
10-
For `from_mins` and `from_hours` see [duration-constructors-lite.md](./duration-constructors-lite.md)

0 commit comments

Comments
 (0)