From 64193188e1429eace2c2b984c409acd36eac6c4a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 17 Jun 2018 21:59:16 +0300 Subject: [PATCH] Undeprecate `thread::sleep_ms` Sleeping is very useful for `printf`-debugging of concurrent code, and `::std::thread::sleep_ms(300)` is much more convenient that `::std::thread::sleep(::std::time::Duration::from_millis(300))`. --- src/libstd/thread/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 1b976b79b4c98..7ed154d837ddc 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -652,6 +652,8 @@ pub fn panicking() -> bool { /// Puts the current thread to sleep for the specified amount of time. /// +/// Equivalent to `sleep(Duration::from_millis(ms))`. +/// /// The thread may sleep longer than the duration specified due to scheduling /// specifics or platform-dependent functionality. /// @@ -669,7 +671,6 @@ pub fn panicking() -> bool { /// thread::sleep_ms(2000); /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_deprecated(since = "1.6.0", reason = "replaced by `std::thread::sleep`")] pub fn sleep_ms(ms: u32) { sleep(Duration::from_millis(ms as u64)) }