@@ -489,9 +489,6 @@ impl<T: 'static + ?Sized> RwLock<T> {
489
489
/// guarded value in a separate task. Returns a `Future` containing the
490
490
/// result of the computation.
491
491
///
492
- /// *This method requires Futures-locks to be build with the `"tokio"`
493
- /// feature.*
494
- ///
495
492
/// When using Tokio, this method will often hold the `RwLock` for less time
496
493
/// than chaining a computation to [`read`](#method.read). The reason is
497
494
/// that Tokio polls all tasks promptly upon notification. However, Tokio
@@ -520,7 +517,8 @@ impl<T: 'static + ?Sized> RwLock<T> {
520
517
/// assert_eq!(r, Ok(5));
521
518
/// # }
522
519
/// ```
523
- #[ cfg( feature = "tokio" ) ]
520
+ #[ cfg( any( feature = "tokio" , all( feature = "nightly-docs" , rustdoc) ) ) ]
521
+ #[ cfg_attr( feature = "nightly-docs" , doc( cfg( feature = "tokio" ) ) ) ]
524
522
pub fn with_read < F , B , R , E > ( & self , f : F )
525
523
-> Result < impl Future < Item = R , Error = E > , SpawnError >
526
524
where F : FnOnce ( RwLockReadGuard < T > ) -> B + Send + ' static ,
@@ -550,9 +548,6 @@ impl<T: 'static + ?Sized> RwLock<T> {
550
548
/// `Send`. Spawns a new task on a single-threaded Runtime to complete the
551
549
/// Future.
552
550
///
553
- /// *This method requires Futures-locks to be build with the `"tokio"`
554
- /// feature.*
555
- ///
556
551
/// # Examples
557
552
///
558
553
/// ```
@@ -575,7 +570,8 @@ impl<T: 'static + ?Sized> RwLock<T> {
575
570
/// assert_eq!(r, Ok(5));
576
571
/// # }
577
572
/// ```
578
- #[ cfg( feature = "tokio" ) ]
573
+ #[ cfg( any( feature = "tokio" , all( feature = "nightly-docs" , rustdoc) ) ) ]
574
+ #[ cfg_attr( feature = "nightly-docs" , doc( cfg( feature = "tokio" ) ) ) ]
579
575
pub fn with_read_local < F , B , R , E > ( & self , f : F )
580
576
-> Result < impl Future < Item = R , Error = E > , SpawnError >
581
577
where F : FnOnce ( RwLockReadGuard < T > ) -> B + ' static ,
@@ -604,9 +600,6 @@ impl<T: 'static + ?Sized> RwLock<T> {
604
600
/// guarded value in a separate task. Returns a `Future` containing the
605
601
/// result of the computation.
606
602
///
607
- /// *This method requires Futures-locks to be build with the `"tokio"`
608
- /// feature.*
609
- ///
610
603
/// When using Tokio, this method will often hold the `RwLock` for less time
611
604
/// than chaining a computation to [`write`](#method.write). The reason is
612
605
/// that Tokio polls all tasks promptly upon notification. However, Tokio
@@ -637,7 +630,8 @@ impl<T: 'static + ?Sized> RwLock<T> {
637
630
/// assert_eq!(rwlock.try_unwrap().unwrap(), 5);
638
631
/// # }
639
632
/// ```
640
- #[ cfg( feature = "tokio" ) ]
633
+ #[ cfg( any( feature = "tokio" , all( feature = "nightly-docs" , rustdoc) ) ) ]
634
+ #[ cfg_attr( feature = "nightly-docs" , doc( cfg( feature = "tokio" ) ) ) ]
641
635
pub fn with_write < F , B , R , E > ( & self , f : F )
642
636
-> Result < impl Future < Item = R , Error = E > , SpawnError >
643
637
where F : FnOnce ( RwLockWriteGuard < T > ) -> B + Send + ' static ,
@@ -667,9 +661,6 @@ impl<T: 'static + ?Sized> RwLock<T> {
667
661
/// `Send`. Spawns a new task on a single-threaded Runtime to complete the
668
662
/// Future.
669
663
///
670
- /// *This method requires Futures-locks to be build with the `"tokio"`
671
- /// feature.*
672
- ///
673
664
/// # Examples
674
665
///
675
666
/// ```
@@ -694,7 +685,8 @@ impl<T: 'static + ?Sized> RwLock<T> {
694
685
/// assert_eq!(*rwlock.try_unwrap().unwrap(), 5);
695
686
/// # }
696
687
/// ```
697
- #[ cfg( feature = "tokio" ) ]
688
+ #[ cfg( any( feature = "tokio" , all( feature = "nightly-docs" , rustdoc) ) ) ]
689
+ #[ cfg_attr( feature = "nightly-docs" , doc( cfg( feature = "tokio" ) ) ) ]
698
690
pub fn with_write_local < F , B , R , E > ( & self , f : F )
699
691
-> Result < impl Future < Item = R , Error = E > , SpawnError >
700
692
where F : FnOnce ( RwLockWriteGuard < T > ) -> B + ' static ,
0 commit comments