Skip to content

Commit c4fdac9

Browse files
committed
Docs for Waker and LocalWaker: Add cross-refs in comment
1 parent 323e962 commit c4fdac9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: core/src/task/wake.rs

+8
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,10 @@ impl Waker {
531531

532532
/// Returns a reference to a `Waker` that does nothing when used.
533533
///
534+
// Note! Much of the documentation for this method is duplicated
535+
// in the docs for `LocalWaker::noop`.
536+
// If you edit it, consider editing the other copy too.
537+
//
534538
/// This is mostly useful for writing tests that need a [`Context`] to poll
535539
/// some futures, but are not expecting those futures to wake the waker or
536540
/// do not need to do anything specific if it happens.
@@ -784,6 +788,10 @@ impl LocalWaker {
784788

785789
/// Creates a new `LocalWaker` that does nothing when `wake` is called.
786790
///
791+
// Note! Much of the documentation for this method is duplicated
792+
// in the docs for `Waker::noop`.
793+
// If you edit it, consider editing the other copy too.
794+
//
787795
/// This is mostly useful for writing tests that need a [`Context`] to poll
788796
/// some futures, but are not expecting those futures to wake the waker or
789797
/// do not need to do anything specific if it happens.

0 commit comments

Comments
 (0)