Skip to content

Commit 66cbbb4

Browse files
committed
Get wasm32-wasip2 compiling with its custom pal implementation
The ordering of targets in `pal/mod.rs` did not end up using the wasip2 implementation, so after reordering that I've edited the implementation to compile correctly.
1 parent a165f1f commit 66cbbb4

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

library/std/src/sys/pal/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ cfg_if::cfg_if! {
3737
} else if #[cfg(target_os = "hermit")] {
3838
mod hermit;
3939
pub use self::hermit::*;
40-
} else if #[cfg(target_os = "wasi")] {
41-
mod wasi;
42-
pub use self::wasi::*;
4340
} else if #[cfg(all(target_os = "wasi", target_env = "p2"))] {
4441
mod wasip2;
4542
pub use self::wasip2::*;
43+
} else if #[cfg(target_os = "wasi")] {
44+
mod wasi;
45+
pub use self::wasi::*;
4646
} else if #[cfg(target_family = "wasm")] {
4747
mod wasm;
4848
pub use self::wasm::*;

library/std/src/sys/pal/wasip2/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
pub mod alloc;
1111
#[path = "../wasi/args.rs"]
1212
pub mod args;
13-
#[path = "../unix/cmath.rs"]
14-
pub mod cmath;
1513
#[path = "../wasi/env.rs"]
1614
pub mod env;
1715
#[path = "../wasi/fd.rs"]
@@ -28,10 +26,6 @@ pub mod io;
2826
pub mod net;
2927
#[path = "../wasi/os.rs"]
3028
pub mod os;
31-
#[path = "../unix/os_str.rs"]
32-
pub mod os_str;
33-
#[path = "../unix/path.rs"]
34-
pub mod path;
3529
#[path = "../unsupported/pipe.rs"]
3630
pub mod pipe;
3731
#[path = "../unsupported/process.rs"]
@@ -51,8 +45,6 @@ cfg_if::cfg_if! {
5145
if #[cfg(target_feature = "atomics")] {
5246
compile_error!("The wasm32-wasip2 target does not support atomics");
5347
} else {
54-
#[path = "../unsupported/locks/mod.rs"]
55-
pub mod locks;
5648
#[path = "../unsupported/once.rs"]
5749
pub mod once;
5850
#[path = "../unsupported/thread_parking.rs"]

0 commit comments

Comments
 (0)