Skip to content

Commit

Permalink
Rollup merge of rust-lang#53507 - phungleson:fix-impl-from-for-waker,…
Browse files Browse the repository at this point in the history
… r=cramertj

Add doc for impl From for Waker

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

The impl is very simple, so not sure if we need to go into any details.
  • Loading branch information
kennytm committed Oct 24, 2018
2 parents f99911a + 3539132 commit f5bc109
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libcore/task/wake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f5bc109

Please sign in to comment.