Warn against thread::sleep in async fn

This commit is contained in:
Kornel 2020-05-12 16:38:02 +01:00
parent d903a9def4
commit 2d39f5abcd

View File

@ -737,6 +737,8 @@ pub fn panicking() -> bool {
/// The thread may sleep longer than the duration specified due to scheduling
/// specifics or platform-dependent functionality. It will never sleep less.
///
/// This function is blocking, and should not be used in `async` functions.
///
/// # Platform-specific behavior
///
/// On Unix platforms, the underlying syscall may be interrupted by a
@ -763,6 +765,8 @@ pub fn sleep_ms(ms: u32) {
/// The thread may sleep longer than the duration specified due to scheduling
/// specifics or platform-dependent functionality. It will never sleep less.
///
/// This function is blocking, and should not be used in `async` functions.
///
/// # Platform-specific behavior
///
/// On Unix platforms, the underlying syscall may be interrupted by a