about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-10-25 14:30:56 +0200
committerGitHub <noreply@github.com>2018-10-25 14:30:56 +0200
commit18f7d41a654307bb883fed660e53df78b00287d0 (patch)
treefda9d5052e87a6277d7ac69c85c50930bd3669d3 /src/libcore
parent365b9001e588cf3d91561894b0e44389e31ae000 (diff)
parent35391326a6e59fb80f851a8345f577a2527eae3c (diff)
downloadrust-18f7d41a654307bb883fed660e53df78b00287d0.tar.gz
rust-18f7d41a654307bb883fed660e53df78b00287d0.zip
Rollup merge of #53507 - phungleson:fix-impl-from-for-waker, r=cramertj
Add doc for impl From for Waker

As part of issue #51430 (cc @skade).

The impl is very simple, so not sure if we need to go into any details.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/task/wake.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs
index ab4ae50c443..c9fb22e0080 100644
--- a/src/libcore/task/wake.rs
+++ b/src/libcore/task/wake.rs
@@ -188,6 +188,11 @@ impl LocalWaker {
 }
 
 impl From<LocalWaker> for Waker {
+    /// Converts a `LocalWaker` into a `Waker`.
+    ///
+    /// This conversion turns a `!Sync` `LocalWaker` into a `Sync` `Waker`, allowing a wakeup
+    /// object to be sent to another thread, but giving up its ability to do specialized
+    /// thread-local wakeup behavior.
     #[inline]
     fn from(local_waker: LocalWaker) -> Self {
         local_waker.0