Skip to content

Commit 843fba3

Browse files
committed
Stabilize checked_duration_since for 1.39.0
Resolves #58402.
1 parent b314654 commit 843fba3

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/libstd/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@
244244
#![feature(cfg_target_has_atomic)]
245245
#![feature(cfg_target_thread_local)]
246246
#![feature(char_error_internals)]
247-
#![feature(checked_duration_since)]
248247
#![feature(clamp)]
249248
#![feature(compiler_builtins_lib)]
250249
#![feature(concat_idents)]

src/libstd/time.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ impl Instant {
221221
/// # Examples
222222
///
223223
/// ```no_run
224-
/// #![feature(checked_duration_since)]
225224
/// use std::time::{Duration, Instant};
226225
/// use std::thread::sleep;
227226
///
@@ -231,7 +230,7 @@ impl Instant {
231230
/// println!("{:?}", new_now.checked_duration_since(now));
232231
/// println!("{:?}", now.checked_duration_since(new_now)); // None
233232
/// ```
234-
#[unstable(feature = "checked_duration_since", issue = "58402")]
233+
#[stable(feature = "checked_duration_since", since = "1.39.0")]
235234
pub fn checked_duration_since(&self, earlier: Instant) -> Option<Duration> {
236235
self.0.checked_sub_instant(&earlier.0)
237236
}
@@ -242,7 +241,6 @@ impl Instant {
242241
/// # Examples
243242
///
244243
/// ```no_run
245-
/// #![feature(checked_duration_since)]
246244
/// use std::time::{Duration, Instant};
247245
/// use std::thread::sleep;
248246
///
@@ -252,7 +250,7 @@ impl Instant {
252250
/// println!("{:?}", new_now.saturating_duration_since(now));
253251
/// println!("{:?}", now.saturating_duration_since(new_now)); // 0ns
254252
/// ```
255-
#[unstable(feature = "checked_duration_since", issue = "58402")]
253+
#[stable(feature = "checked_duration_since", since = "1.39.0")]
256254
pub fn saturating_duration_since(&self, earlier: Instant) -> Duration {
257255
self.checked_duration_since(earlier).unwrap_or(Duration::new(0, 0))
258256
}

0 commit comments

Comments
 (0)