Skip to content

Commit

Permalink
[unstable-rust] Use feature(noop_waker) instead of futures's waker.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed May 7, 2024
1 parent fd98b57 commit fc423af
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions all-is-cubes-gpu/src/in_wgpu/shaders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::sync::Arc;
use std::task;

use futures_core::future::BoxFuture;
use futures_util::task::noop_waker_ref;
use once_cell::sync::Lazy;

use all_is_cubes::listen;
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions all-is-cubes-gpu/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
5 changes: 2 additions & 3 deletions all-is-cubes-ui/src/apps/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -414,7 +413,7 @@ impl<I: time::Instant> Session<I> {

let future: Pin<&mut dyn Future<Output = ExitMainTask>> =
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;
Expand Down
1 change: 1 addition & 0 deletions all-is-cubes-ui/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(never_type)]
#![feature(noop_waker)]

//! User interface framework and screens for [`all_is_cubes`].
//!
Expand Down

0 comments on commit fc423af

Please sign in to comment.