Skip to content

Commit d0d277d

Browse files
fix wasm32 compiles
1 parent 04cc2fd commit d0d277d

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

Diff for: src/task/builder.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::cell::Cell;
21
use std::future::Future;
32
use std::pin::Pin;
43
use std::sync::Arc;
@@ -7,7 +6,7 @@ use std::task::{Context, Poll};
76
use pin_project_lite::pin_project;
87

98
use crate::io;
10-
use crate::task::{self, JoinHandle, Task, TaskLocalsWrapper};
9+
use crate::task::{JoinHandle, Task, TaskLocalsWrapper};
1110

1211
/// Task builder that configures the settings of a new task.
1312
#[derive(Debug, Default)]
@@ -61,7 +60,7 @@ impl Builder {
6160
});
6261

6362
let task = wrapped.tag.task().clone();
64-
let handle = task::executor::spawn(wrapped);
63+
let handle = crate::task::executor::spawn(wrapped);
6564

6665
Ok(JoinHandle::new(handle, task))
6766
}
@@ -81,7 +80,7 @@ impl Builder {
8180
});
8281

8382
let task = wrapped.tag.task().clone();
84-
let handle = task::executor::local(wrapped);
83+
let handle = crate::task::executor::local(wrapped);
8584

8685
Ok(JoinHandle::new(handle, task))
8786
}
@@ -143,6 +142,8 @@ impl Builder {
143142
where
144143
F: Future<Output = T>,
145144
{
145+
use std::cell::Cell;
146+
146147
let wrapped = self.build(future);
147148

148149
// Log this `block_on` operation.
@@ -167,7 +168,7 @@ impl Builder {
167168
TaskLocalsWrapper::set_current(&wrapped.tag, || {
168169
let res = if should_run {
169170
// The first call should run the executor
170-
task::executor::run(wrapped)
171+
crate::task::executor::run(wrapped)
171172
} else {
172173
futures_lite::future::block_on(wrapped)
173174
};

Diff for: tests/collect.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[cfg(feature = "unstable")]
22
#[test]
3-
fn test_send() -> async_std::io::Result<()> {
3+
fn test_send() {
44
use async_std::prelude::*;
55
use async_std::{stream, task};
66

@@ -14,7 +14,5 @@ fn test_send() -> async_std::io::Result<()> {
1414

1515
// This line triggers a compilation error
1616
test_send_trait(&fut);
17-
18-
Ok(())
19-
})
17+
});
2018
}

0 commit comments

Comments
 (0)