@@ -622,7 +622,7 @@ impl LocalWaker {
622
622
///
623
623
/// [`poll()`]: crate::future::Future::poll
624
624
#[ inline]
625
- #[ stable ( feature = "futures_api " , since = "1.36.0 " ) ]
625
+ #[ unstable ( feature = "local_waker " , issue = "118959 " ) ]
626
626
pub fn wake ( self ) {
627
627
// The actual wakeup call is delegated through a virtual function call
628
628
// to the implementation which is defined by the executor.
@@ -644,7 +644,7 @@ impl LocalWaker {
644
644
/// the case where an owned `Waker` is available. This method should be preferred to
645
645
/// calling `waker.clone().wake()`.
646
646
#[ inline]
647
- #[ stable ( feature = "futures_api " , since = "1.36.0 " ) ]
647
+ #[ unstable ( feature = "local_waker " , issue = "118959 " ) ]
648
648
pub fn wake_by_ref ( & self ) {
649
649
// The actual wakeup call is delegated through a virtual function call
650
650
// to the implementation which is defined by the executor.
@@ -664,7 +664,7 @@ impl LocalWaker {
664
664
/// avoid cloning the waker when they would wake the same task anyway.
665
665
#[ inline]
666
666
#[ must_use]
667
- #[ stable ( feature = "futures_api " , since = "1.36.0 " ) ]
667
+ #[ unstable ( feature = "local_waker " , issue = "118959 " ) ]
668
668
pub fn will_wake ( & self , other : & LocalWaker ) -> bool {
669
669
self . waker == other. waker
670
670
}
@@ -676,7 +676,7 @@ impl LocalWaker {
676
676
/// Therefore this method is unsafe.
677
677
#[ inline]
678
678
#[ must_use]
679
- #[ stable ( feature = "futures_api " , since = "1.36.0 " ) ]
679
+ #[ unstable ( feature = "local_waker " , issue = "118959 " ) ]
680
680
#[ rustc_const_unstable( feature = "const_waker" , issue = "102012" ) ]
681
681
pub const unsafe fn from_raw ( waker : RawWaker ) -> LocalWaker {
682
682
Self { waker }
@@ -748,7 +748,18 @@ impl AsRef<LocalWaker> for Waker {
748
748
}
749
749
}
750
750
751
- #[ stable( feature = "futures_api" , since = "1.36.0" ) ]
751
+ #[ unstable( feature = "local_waker" , issue = "118959" ) ]
752
+ impl Drop for LocalWaker {
753
+ #[ inline]
754
+ fn drop ( & mut self ) {
755
+ // SAFETY: This is safe because `LocalWaker::from_raw` is the only way
756
+ // to initialize `drop` and `data` requiring the user to acknowledge
757
+ // that the contract of `RawWaker` is upheld.
758
+ unsafe { ( self . waker . vtable . drop ) ( self . waker . data ) }
759
+ }
760
+ }
761
+
762
+ #[ unstable( feature = "local_waker" , issue = "118959" ) ]
752
763
impl fmt:: Debug for LocalWaker {
753
764
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
754
765
let vtable_ptr = self . waker . vtable as * const RawWakerVTable ;
0 commit comments