about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-04-24 12:17:06 +0900
committerGitHub <noreply@github.com>2021-04-24 12:17:06 +0900
commited5646bfeed5ccf8d4f17fe76efd47ce1731d050 (patch)
tree5a3d75e0caee75b8e5eddfe8e7049dec19856715 /library/alloc/src
parent570eed71ef123557ca8c4c527c404f1331282ef1 (diff)
parent60ff298070842e8bb47078c7c3a0dbbdebc1d5a6 (diff)
downloadrust-ed5646bfeed5ccf8d4f17fe76efd47ce1731d050.tar.gz
rust-ed5646bfeed5ccf8d4f17fe76efd47ce1731d050.zip
Rollup merge of #84453 - notriddle:waker-from-docs, r=cramertj
Document From implementations for Waker and RawWaker

CC #51430
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/task.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/alloc/src/task.rs b/library/alloc/src/task.rs
index 58a9ae77244..528ee4ff154 100644
--- a/library/alloc/src/task.rs
+++ b/library/alloc/src/task.rs
@@ -87,6 +87,9 @@ pub trait Wake {
 
 #[stable(feature = "wake_trait", since = "1.51.0")]
 impl<W: Wake + Send + Sync + 'static> From<Arc<W>> for Waker {
+    /// Use a `Wake`-able type as a `Waker`.
+    ///
+    /// No heap allocations or atomic operations are used for this conversion.
     fn from(waker: Arc<W>) -> Waker {
         // SAFETY: This is safe because raw_waker safely constructs
         // a RawWaker from Arc<W>.
@@ -96,6 +99,9 @@ impl<W: Wake + Send + Sync + 'static> From<Arc<W>> for Waker {
 
 #[stable(feature = "wake_trait", since = "1.51.0")]
 impl<W: Wake + Send + Sync + 'static> From<Arc<W>> for RawWaker {
+    /// Use a `Wake`-able type as a `RawWaker`.
+    ///
+    /// No heap allocations or atomic operations are used for this conversion.
     fn from(waker: Arc<W>) -> RawWaker {
         raw_waker(waker)
     }