From c4a1a0055560f6705f1df19e57ce57c5151ad023 Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Tue, 19 Dec 2023 08:48:43 -0800 Subject: [PATCH] [unstable-rust] Use `feature(noop_waker)` instead of `futures`'s waker. --- all-is-cubes-gpu/src/in_wgpu/shaders.rs | 5 ++--- all-is-cubes-gpu/src/lib.rs | 1 + all-is-cubes-ui/src/apps/session.rs | 5 ++--- all-is-cubes-ui/src/lib.rs | 1 + 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/all-is-cubes-gpu/src/in_wgpu/shaders.rs b/all-is-cubes-gpu/src/in_wgpu/shaders.rs index 49ccd2e83..e7ab864e9 100644 --- a/all-is-cubes-gpu/src/in_wgpu/shaders.rs +++ b/all-is-cubes-gpu/src/in_wgpu/shaders.rs @@ -2,11 +2,10 @@ use std::borrow::Cow; use std::sync::Arc; -use std::task; use std::sync::LazyLock as Lazy; +use std::task; use futures_core::future::BoxFuture; -use futures_util::task::noop_waker_ref; use all_is_cubes::listen; @@ -161,7 +160,7 @@ impl ReloadableShader { if let Some(f) = self.next_module.as_mut() { if let task::Poll::Ready(result) = f .as_mut() - .poll(&mut task::Context::from_waker(noop_waker_ref())) + .poll(&mut task::Context::from_waker(task::Waker::noop())) { self.next_module = None; match result { diff --git a/all-is-cubes-gpu/src/lib.rs b/all-is-cubes-gpu/src/lib.rs index 0dfbc1a95..af37c7a95 100644 --- a/all-is-cubes-gpu/src/lib.rs +++ b/all-is-cubes-gpu/src/lib.rs @@ -1,4 +1,5 @@ #![feature(never_type)] +#![feature(noop_waker)] //! Algorithms for rendering [All is Cubes] content using a GPU, via //! the [`wgpu`] graphics library. diff --git a/all-is-cubes-ui/src/apps/session.rs b/all-is-cubes-ui/src/apps/session.rs index 5f7638284..ac27608e9 100644 --- a/all-is-cubes-ui/src/apps/session.rs +++ b/all-is-cubes-ui/src/apps/session.rs @@ -5,12 +5,11 @@ use core::marker::PhantomData; use core::mem; use core::pin::Pin; use core::sync::atomic::{AtomicBool, Ordering}; -use core::task::{Context, Poll}; +use core::task::{Context, Poll, Waker}; use std::sync::RwLock; use flume::TryRecvError; use futures_core::future::BoxFuture; -use futures_task::noop_waker_ref; use sync_wrapper::SyncWrapper; use all_is_cubes::arcstr::{self, ArcStr}; @@ -420,7 +419,7 @@ impl Session { let future: Pin<&mut dyn Future> = sync_wrapped_future.get_mut().as_mut(); - match future.poll(&mut Context::from_waker(noop_waker_ref())) { + match future.poll(&mut Context::from_waker(Waker::noop())) { Poll::Pending => {} Poll::Ready(ExitMainTask) => { self.main_task = None; diff --git a/all-is-cubes-ui/src/lib.rs b/all-is-cubes-ui/src/lib.rs index 1c78f187f..648e9ad8a 100644 --- a/all-is-cubes-ui/src/lib.rs +++ b/all-is-cubes-ui/src/lib.rs @@ -1,4 +1,5 @@ #![feature(never_type)] +#![feature(noop_waker)] #![feature(precise_capturing)] //! User interface framework and screens for [`all_is_cubes`].