Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm32-wasi target support #1576

Merged
merged 1 commit into from
Jun 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ rustdoc-args = ["--cfg", "docsrs"]
targets = [
"aarch64-apple-ios",
"aarch64-linux-android",
"wasm32-wasi",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"x86_64-unknown-dragonfly",
Expand Down
1 change: 0 additions & 1 deletion src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@ impl Registry {
///
/// Event sources registered with this `Registry` will be registered with
/// the original `Registry` and `Poll` instance.
#[cfg(not(target_os = "wasi"))]
pub fn try_clone(&self) -> io::Result<Registry> {
self.selector
.try_clone()
Expand Down
1 change: 0 additions & 1 deletion src/sys/shell/selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pub type Events = Vec<Event>;
pub struct Selector {}

impl Selector {
#[cfg(not(target_os = "wasi"))]
pub fn try_clone(&self) -> io::Result<Selector> {
os_required!();
}
Expand Down
7 changes: 7 additions & 0 deletions src/sys/wasi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ impl Selector {
}
}

pub(crate) fn try_clone(&self) -> io::Result<Selector> {
Ok(Selector {
id: self.id,
subscriptions: self.subscriptions.clone(),
})
}

#[cfg(feature = "net")]
pub(crate) fn register(
&self,
Expand Down