5858< a href =#58 id =58 data-nosnippet > 58</ a > < span class ="kw "> use </ span > core::future::Future < span class ="kw "> as _</ span > ;
5959< a href =#59 id =59 data-nosnippet > 59</ a > < span class ="kw "> use </ span > core::pin::pin;
6060< a href =#60 id =60 data-nosnippet > 60</ a > < span class ="kw "> use </ span > core::task;
61- < a href =#61 id =61 data-nosnippet > 61</ a > < span class ="kw "> let </ span > ctx = < span class ="kw-2 "> &mut </ span > task::Context::from_waker(waker::noop_waker_ref ());
61+ < a href =#61 id =61 data-nosnippet > 61</ a > < span class ="kw "> let </ span > ctx = < span class ="kw-2 "> &mut </ span > task::Context::from_waker(task::Waker::noop ());
6262< a href =#62 id =62 data-nosnippet > 62</ a >
6363< a href =#63 id =63 data-nosnippet > 63</ a > < span class ="kw "> let </ span > instance = Instance::new(< span class ="kw-2 "> &</ span > InstanceDescriptor {
6464< a href =#64 id =64 data-nosnippet > 64</ a > backends: Backends::NOOP,
794794< a href =#794 id =794 data-nosnippet > 794</ a > Error::Internal { description, .. } => f.write_str(description),
795795< a href =#795 id =795 data-nosnippet > 795</ a > }
796796< a href =#796 id =796 data-nosnippet > 796</ a > }
797- < a href =#797 id =797 data-nosnippet > 797</ a > }
798- < a href =#798 id =798 data-nosnippet > 798</ a >
799- < a href =#799 id =799 data-nosnippet > 799</ a > < span class ="comment "> // Copied from [`futures::task::noop_waker`].
800- < a href =#800 id =800 data-nosnippet > 800</ a > // Needed until MSRV is 1.85 with `task::Waker::noop()` available
801- < a href =#801 id =801 data-nosnippet > 801</ a > </ span > < span class ="attr "> #[cfg(feature = < span class ="string "> "noop"</ span > )]
802- < a href =#802 id =802 data-nosnippet > 802</ a > </ span > < span class ="kw "> mod </ span > waker {
803- < a href =#803 id =803 data-nosnippet > 803</ a > < span class ="kw "> use </ span > core::ptr::null;
804- < a href =#804 id =804 data-nosnippet > 804</ a > < span class ="kw "> use </ span > core::task::{RawWaker, RawWakerVTable, Waker};
805- < a href =#805 id =805 data-nosnippet > 805</ a >
806- < a href =#806 id =806 data-nosnippet > 806</ a > < span class ="kw "> unsafe fn </ span > noop_clone(_data: < span class ="kw-2 "> *const </ span > ()) -> RawWaker {
807- < a href =#807 id =807 data-nosnippet > 807</ a > noop_raw_waker()
808- < a href =#808 id =808 data-nosnippet > 808</ a > }
809- < a href =#809 id =809 data-nosnippet > 809</ a >
810- < a href =#810 id =810 data-nosnippet > 810</ a > < span class ="kw "> unsafe fn </ span > noop(_data: < span class ="kw-2 "> *const </ span > ()) {}
811- < a href =#811 id =811 data-nosnippet > 811</ a >
812- < a href =#812 id =812 data-nosnippet > 812</ a > < span class ="kw "> const </ span > NOOP_WAKER_VTABLE: RawWakerVTable = RawWakerVTable::new(noop_clone, noop, noop, noop);
813- < a href =#813 id =813 data-nosnippet > 813</ a >
814- < a href =#814 id =814 data-nosnippet > 814</ a > < span class ="kw "> const fn </ span > noop_raw_waker() -> RawWaker {
815- < a href =#815 id =815 data-nosnippet > 815</ a > RawWaker::new(null(), < span class ="kw-2 "> &</ span > NOOP_WAKER_VTABLE)
816- < a href =#816 id =816 data-nosnippet > 816</ a > }
817- < a href =#817 id =817 data-nosnippet > 817</ a >
818- < a href =#818 id =818 data-nosnippet > 818</ a > < span class ="doccomment "> /// Get a static reference to a [`Waker`] which
819- < a href =#819 id =819 data-nosnippet > 819</ a > /// does nothing when `wake()` is called on it.
820- < a href =#820 id =820 data-nosnippet > 820</ a > </ span > < span class ="attr "> #[inline]
821- < a href =#821 id =821 data-nosnippet > 821</ a > </ span > < span class ="kw "> pub fn </ span > noop_waker_ref() -> < span class ="kw-2 "> &</ span > < span class ="lifetime "> 'static </ span > Waker {
822- < a href =#822 id =822 data-nosnippet > 822</ a > < span class ="kw "> struct </ span > SyncRawWaker(RawWaker);
823- < a href =#823 id =823 data-nosnippet > 823</ a > < span class ="kw "> unsafe impl </ span > Sync < span class ="kw "> for </ span > SyncRawWaker {}
824- < a href =#824 id =824 data-nosnippet > 824</ a >
825- < a href =#825 id =825 data-nosnippet > 825</ a > < span class ="kw "> static </ span > NOOP_WAKER_INSTANCE: SyncRawWaker = SyncRawWaker(noop_raw_waker());
826- < a href =#826 id =826 data-nosnippet > 826</ a >
827- < a href =#827 id =827 data-nosnippet > 827</ a > < span class ="comment "> // SAFETY: `Waker` is #[repr(transparent)] over its `RawWaker`.
828- < a href =#828 id =828 data-nosnippet > 828</ a > </ span > < span class ="kw "> unsafe </ span > { < span class ="kw-2 "> &*</ span > (< span class ="kw-2 "> &</ span > NOOP_WAKER_INSTANCE.< span class ="number "> 0 </ span > < span class ="kw "> as </ span > < span class ="kw-2 "> *const </ span > RawWaker < span class ="kw "> as </ span > < span class ="kw-2 "> *const </ span > Waker) }
829- < a href =#829 id =829 data-nosnippet > 829</ a > }
830- < a href =#830 id =830 data-nosnippet > 830</ a > }</ code > </ pre > </ div > </ section > </ main > </ body > </ html >
797+ < a href =#797 id =797 data-nosnippet > 797</ a > }</ code > </ pre > </ div > </ section > </ main > </ body > </ html >
0 commit comments