Skip to content

Commit 023924b

Browse files
committed
Rename noop/panic waker and fix other compilation issue
1 parent 803097a commit 023924b

File tree

21 files changed

+820
-57
lines changed

21 files changed

+820
-57
lines changed

futures-channel/benches/sync_mpsc.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ use {
1111
sink::Sink,
1212
task::{Waker, Poll},
1313
},
14-
futures_test::task::noop_local_waker_ref,
14+
futures_test::task::noop_waker_ref,
1515
std::pin::Pin,
1616
};
1717

1818
/// Single producer, single consumer
1919
#[bench]
2020
fn unbounded_1_tx(b: &mut Bencher) {
21-
let waker = noop_local_waker_ref();
21+
let waker = noop_waker_ref();
2222
b.iter(|| {
2323
let (tx, mut rx) = mpsc::unbounded();
2424

@@ -40,7 +40,7 @@ fn unbounded_1_tx(b: &mut Bencher) {
4040
/// 100 producers, single consumer
4141
#[bench]
4242
fn unbounded_100_tx(b: &mut Bencher) {
43-
let waker = noop_local_waker_ref();
43+
let waker = noop_waker_ref();
4444
b.iter(|| {
4545
let (tx, mut rx) = mpsc::unbounded();
4646

@@ -61,7 +61,7 @@ fn unbounded_100_tx(b: &mut Bencher) {
6161

6262
#[bench]
6363
fn unbounded_uncontended(b: &mut Bencher) {
64-
let waker = noop_local_waker_ref();
64+
let waker = noop_waker_ref();
6565
b.iter(|| {
6666
let (tx, mut rx) = mpsc::unbounded();
6767

@@ -101,7 +101,7 @@ impl Stream for TestSender {
101101
/// Single producers, single consumer
102102
#[bench]
103103
fn bounded_1_tx(b: &mut Bencher) {
104-
let waker = noop_local_waker_ref();
104+
let waker = noop_waker_ref();
105105
b.iter(|| {
106106
let (tx, mut rx) = mpsc::channel(0);
107107

@@ -118,7 +118,7 @@ fn bounded_1_tx(b: &mut Bencher) {
118118
/// 100 producers, single consumer
119119
#[bench]
120120
fn bounded_100_tx(b: &mut Bencher) {
121-
let waker = noop_local_waker_ref();
121+
let waker = noop_waker_ref();
122122
b.iter(|| {
123123
// Each sender can send one item after specified capacity
124124
let (tx, mut rx) = mpsc::channel(0);

futures-channel/src/mpsc/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,12 +649,12 @@ impl<T> Sender<T> {
649649
/// - `Err(SendError)` if the receiver has been dropped.
650650
pub fn poll_ready(
651651
&mut self,
652-
lw: &LocalWaker
652+
waker: &Waker
653653
) -> Poll<Result<(), SendError>> {
654654
let inner = self.0.as_mut().ok_or(SendError {
655655
kind: SendErrorKind::Disconnected,
656656
})?;
657-
inner.poll_ready(lw)
657+
inner.poll_ready(waker)
658658
}
659659

660660
/// Returns whether this channel is closed without needing a context.

futures-channel/tests/mpsc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use futures::future::{FutureExt, poll_fn};
66
use futures::stream::{Stream, StreamExt};
77
use futures::sink::{Sink, SinkExt};
88
use futures::task::Poll;
9-
use futures_test::task::noop_local_waker_ref;
9+
use futures_test::task::noop_waker_ref;
1010
use pin_utils::pin_mut;
1111
use std::sync::{Arc, Mutex};
1212
use std::sync::atomic::{AtomicUsize, Ordering};
@@ -304,7 +304,7 @@ fn stress_receiver_multi_task_bounded_hard() {
304304
} else {
305305
// Just poll
306306
let n = n.clone();
307-
match rx.poll_next_unpin(noop_local_waker_ref()) {
307+
match rx.poll_next_unpin(noop_waker_ref()) {
308308
Poll::Ready(Some(_)) => {
309309
n.fetch_add(1, Ordering::Relaxed);
310310
}

0 commit comments

Comments
 (0)