From 1e8261861385a5cabc7df2ecab7132ae5226fae0 Mon Sep 17 00:00:00 2001 From: Sunjay Varma Date: Tue, 25 Dec 2018 14:23:48 -0700 Subject: [PATCH] Stabilize duration_as_u128 --- src/liballoc/benches/vec_deque_append.rs | 2 +- src/libcore/time.rs | 9 +++------ src/libstd/lib.rs | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/liballoc/benches/vec_deque_append.rs b/src/liballoc/benches/vec_deque_append.rs index 327998b6f44f2..2db8fbe130907 100644 --- a/src/liballoc/benches/vec_deque_append.rs +++ b/src/liballoc/benches/vec_deque_append.rs @@ -1,4 +1,4 @@ -#![feature(duration_as_u128)] +#![cfg_attr(stage0, feature(duration_as_u128))] use std::{collections::VecDeque, time::Instant}; const VECDEQUE_LEN: i32 = 100000; diff --git a/src/libcore/time.rs b/src/libcore/time.rs index 643b3bdc411dc..b12ee0497d2c2 100644 --- a/src/libcore/time.rs +++ b/src/libcore/time.rs @@ -265,13 +265,12 @@ impl Duration { /// # Examples /// /// ``` - /// # #![feature(duration_as_u128)] /// use std::time::Duration; /// /// let duration = Duration::new(5, 730023852); /// assert_eq!(duration.as_millis(), 5730); /// ``` - #[unstable(feature = "duration_as_u128", issue = "50202")] + #[stable(feature = "duration_as_u128", since = "1.33.0")] #[inline] pub const fn as_millis(&self) -> u128 { self.secs as u128 * MILLIS_PER_SEC as u128 + (self.nanos / NANOS_PER_MILLI) as u128 @@ -282,13 +281,12 @@ impl Duration { /// # Examples /// /// ``` - /// # #![feature(duration_as_u128)] /// use std::time::Duration; /// /// let duration = Duration::new(5, 730023852); /// assert_eq!(duration.as_micros(), 5730023); /// ``` - #[unstable(feature = "duration_as_u128", issue = "50202")] + #[stable(feature = "duration_as_u128", since = "1.33.0")] #[inline] pub const fn as_micros(&self) -> u128 { self.secs as u128 * MICROS_PER_SEC as u128 + (self.nanos / NANOS_PER_MICRO) as u128 @@ -299,13 +297,12 @@ impl Duration { /// # Examples /// /// ``` - /// # #![feature(duration_as_u128)] /// use std::time::Duration; /// /// let duration = Duration::new(5, 730023852); /// assert_eq!(duration.as_nanos(), 5730023852); /// ``` - #[unstable(feature = "duration_as_u128", issue = "50202")] + #[stable(feature = "duration_as_u128", since = "1.33.0")] #[inline] pub const fn as_nanos(&self) -> u128 { self.secs as u128 * NANOS_PER_SEC as u128 + self.nanos as u128 diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 5ab7d4693919a..55f10e26b7b71 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -248,7 +248,7 @@ #![feature(const_cstr_unchecked)] #![feature(core_intrinsics)] #![feature(dropck_eyepatch)] -#![feature(duration_as_u128)] +#![cfg_attr(stage0, feature(duration_as_u128))] #![feature(exact_size_is_empty)] #![feature(external_doc)] #![feature(fixed_size_array)]