From f8550a499fcc3c2589ada33dbb3081d77ee968bc Mon Sep 17 00:00:00 2001 From: Son Date: Mon, 20 Aug 2018 12:05:41 +1000 Subject: [PATCH 1/3] Add doc for impl From for Waker --- src/libcore/task/wake.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs index ab4ae50c443..7cc200837b4 100644 --- a/src/libcore/task/wake.rs +++ b/src/libcore/task/wake.rs @@ -188,6 +188,13 @@ impl LocalWaker { } impl From for Waker { + /// Converts a [`LocalWaker`] into a [`Waker`]. + /// + /// This conversion forgets local waker and allocates a new waker with + /// the same inner. + /// + /// [`LocalWaker`]: struct.LocalWaker.html + /// [`Waker`]: struct.Waker.html #[inline] fn from(local_waker: LocalWaker) -> Self { local_waker.0 From a70ef6a20bbb9d2ac557e54acccb97e7662550ce Mon Sep 17 00:00:00 2001 From: Son Date: Wed, 17 Oct 2018 08:03:12 +1100 Subject: [PATCH 2/3] Seems like we don't have to refer the file anymore. --- src/libcore/task/wake.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs index 7cc200837b4..c2768e70aec 100644 --- a/src/libcore/task/wake.rs +++ b/src/libcore/task/wake.rs @@ -188,13 +188,10 @@ impl LocalWaker { } impl From for Waker { - /// Converts a [`LocalWaker`] into a [`Waker`]. + /// Converts a `LocalWaker` into a `Waker`. /// /// This conversion forgets local waker and allocates a new waker with /// the same inner. - /// - /// [`LocalWaker`]: struct.LocalWaker.html - /// [`Waker`]: struct.Waker.html #[inline] fn from(local_waker: LocalWaker) -> Self { local_waker.0 From 35391326a6e59fb80f851a8345f577a2527eae3c Mon Sep 17 00:00:00 2001 From: Son Date: Wed, 24 Oct 2018 09:28:04 +1100 Subject: [PATCH 3/3] Update comment based on suggestion. --- src/libcore/task/wake.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs index c2768e70aec..c9fb22e0080 100644 --- a/src/libcore/task/wake.rs +++ b/src/libcore/task/wake.rs @@ -190,8 +190,9 @@ impl LocalWaker { impl From for Waker { /// Converts a `LocalWaker` into a `Waker`. /// - /// This conversion forgets local waker and allocates a new waker with - /// the same inner. + /// 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