Skip to content

Stabilize duration_constructors_lite feature #145135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions library/core/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,15 @@ impl Duration {
/// # Examples
///
/// ```
/// #![feature(duration_constructors_lite)]
/// use std::time::Duration;
///
/// let duration = Duration::from_hours(6);
///
/// 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 {
Expand All @@ -401,15 +401,15 @@ impl Duration {
/// # Examples
///
/// ```
/// #![feature(duration_constructors_lite)]
/// use std::time::Duration;
///
/// let duration = Duration::from_mins(10);
///
/// 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 {
Expand Down
1 change: 0 additions & 1 deletion library/coretests/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading