mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-23 02:27:39 +03:00
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.
This commit is contained in:
@@ -188,6 +188,11 @@ pub fn will_wake_nonlocal(&self, other: &Waker) -> bool {
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user