@@ -284,7 +284,7 @@ impl fmt::Debug for Context<'_> {
284
284
/// use std::future::Future;
285
285
///
286
286
/// let local_waker = LocalWaker::noop();
287
- /// let waker = Waker::noop() ;
287
+ /// let waker = Waker::NOOP ;
288
288
///
289
289
/// let mut cx = ContextBuilder::from_waker(&waker)
290
290
/// .local_waker(&local_waker)
@@ -465,7 +465,7 @@ impl Waker {
465
465
Waker { waker }
466
466
}
467
467
468
- /// Returns a reference to a `Waker` that does nothing when used.
468
+ /// A reference to a `Waker` that does nothing when used.
469
469
///
470
470
/// This is mostly useful for writing tests that need a [`Context`] to poll
471
471
/// some futures, but are not expecting those futures to wake the waker or
@@ -481,18 +481,13 @@ impl Waker {
481
481
/// use std::future::Future;
482
482
/// use std::task;
483
483
///
484
- /// let mut cx = task::Context::from_waker(task::Waker::noop() );
484
+ /// let mut cx = task::Context::from_waker(task::Waker::NOOP );
485
485
///
486
486
/// let mut future = Box::pin(async { 10 });
487
487
/// assert_eq!(future.as_mut().poll(&mut cx), task::Poll::Ready(10));
488
488
/// ```
489
- #[ inline]
490
- #[ must_use]
491
489
#[ unstable( feature = "noop_waker" , issue = "98286" ) ]
492
- pub const fn noop ( ) -> & ' static Waker {
493
- const WAKER : & Waker = & Waker { waker : RawWaker :: NOOP } ;
494
- WAKER
495
- }
490
+ pub const NOOP : & ' static Waker = & Waker { waker : RawWaker :: NOOP } ;
496
491
497
492
/// Get a reference to the underlying [`RawWaker`].
498
493
#[ inline]
@@ -697,7 +692,7 @@ impl LocalWaker {
697
692
/// use std::future::Future;
698
693
/// use std::task::{ContextBuilder, LocalWaker, Waker, Poll};
699
694
///
700
- /// let mut cx = ContextBuilder::from_waker(Waker::noop() )
695
+ /// let mut cx = ContextBuilder::from_waker(Waker::NOOP )
701
696
/// .local_waker(LocalWaker::noop())
702
697
/// .build();
703
698
///
0 commit comments