diff --git a/Cargo.toml b/Cargo.toml index 7136a4f..dba4178 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ serde_core = { version = "1", features = ["alloc"], default-features = false, op default = ["std"] std = [] serde = ["dep:serde_core"] +nightly-wasip2 = ["std"] [[example]] name = "typed" diff --git a/src/common/non_utf8/path.rs b/src/common/non_utf8/path.rs index 8882531..83582ee 100644 --- a/src/common/non_utf8/path.rs +++ b/src/common/non_utf8/path.rs @@ -1568,7 +1568,7 @@ where all(target_vendor = "fortanix", target_env = "sgx"), target_os = "solid_asp3", target_os = "hermit", - target_os = "wasi" + all(target_os = "wasi", any(not(target_env = "p2"), feature = "nightly-wasip2")) ))] #[cfg(feature = "std")] mod std_conversions { diff --git a/src/common/non_utf8/pathbuf.rs b/src/common/non_utf8/pathbuf.rs index 2823450..3438e45 100644 --- a/src/common/non_utf8/pathbuf.rs +++ b/src/common/non_utf8/pathbuf.rs @@ -834,7 +834,7 @@ where all(target_vendor = "fortanix", target_env = "sgx"), target_os = "solid_asp3", target_os = "hermit", - target_os = "wasi" + all(target_os = "wasi", any(not(target_env = "p2"), feature = "nightly-wasip2")) ))] #[cfg(feature = "std")] mod std_conversions { diff --git a/src/common/utf8/path.rs b/src/common/utf8/path.rs index 30efc9d..0edc502 100644 --- a/src/common/utf8/path.rs +++ b/src/common/utf8/path.rs @@ -1550,7 +1550,7 @@ where all(target_vendor = "fortanix", target_env = "sgx"), target_os = "solid_asp3", target_os = "hermit", - target_os = "wasi" + all(target_os = "wasi", any(not(target_env = "p2"), feature = "nightly-wasip2")) ))] #[cfg(feature = "std")] mod std_conversions { diff --git a/src/common/utf8/pathbuf.rs b/src/common/utf8/pathbuf.rs index a64092a..88699b5 100644 --- a/src/common/utf8/pathbuf.rs +++ b/src/common/utf8/pathbuf.rs @@ -866,7 +866,7 @@ where all(target_vendor = "fortanix", target_env = "sgx"), target_os = "solid_asp3", target_os = "hermit", - target_os = "wasi" + all(target_os = "wasi", any(not(target_env = "p2"), feature = "nightly-wasip2")) ))] #[cfg(feature = "std")] mod std_conversions { diff --git a/src/lib.rs b/src/lib.rs index 4ddda57..9fadd63 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ #![cfg_attr(feature = "std", doc = include_str!("../README.md"))] #![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(all(target_os = "wasi", target_env = "p2"), feature(wasip2))] +#![cfg_attr(all(feature = "nightly-wasip2", target_os = "wasi", target_env = "p2"), feature(wasip2))] #[doc = include_str!("../README.md")] #[cfg(all(doctest, feature = "std"))]