docs: add note about current-thread + Handle::block_on (#5264)

There's already an existing warning about this combo in the
documentation for `Handle::block_on`. This commit adds a summarized
version in `Runtime::handle`.
This commit is contained in:
sharnoff
2022-12-05 00:14:05 -06:00
committed by GitHub
parent 00bf5ee8a8
commit 86ffabe2af
+3
View File
@@ -138,6 +138,9 @@ impl Runtime {
/// The returned handle can be used to spawn tasks that run on this runtime, and can
/// be cloned to allow moving the `Handle` to other threads.
///
/// Calling [`Handle::block_on`] on a handle to a `current_thread` runtime is error-prone.
/// Refer to the documentation of [`Handle::block_on`] for more.
///
/// # Examples
///
/// ```