diff --git a/library/alloc/src/task.rs b/library/alloc/src/task.rs index 58a9ae77244fb..528ee4ff1542c 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 From> 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) -> Waker { // SAFETY: This is safe because raw_waker safely constructs // a RawWaker from Arc. @@ -96,6 +99,9 @@ impl From> for Waker { #[stable(feature = "wake_trait", since = "1.51.0")] impl From> 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) -> RawWaker { raw_waker(waker) }