From 23b9be764a01de50a1abd743b9a3ea5ab04e9cd5 Mon Sep 17 00:00:00 2001 From: Colin Murphy Date: Tue, 5 Nov 2024 08:48:47 -0500 Subject: [PATCH] fix: enable wasip2 feature for wasm32-wasip2 target --- Cargo.toml | 2 +- src/lib.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index dd9a0d4d4..6bc5e0d3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ fastrand = "2.1.1" once_cell = { version = "1.19.0", default-features = false, features = ["std"] } [target.'cfg(any(unix, target_os = "wasi"))'.dependencies] -rustix = { version = "0.38.37", features = ["fs"] } +rustix = { version = "0.38.39", features = ["fs"] } [target.'cfg(windows)'.dependencies.windows-sys] version = ">=0.52,<=0.59" diff --git a/src/lib.rs b/src/lib.rs index 459afbec5..ea4933856 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,6 @@ +// wasip2 conditionally gates stdlib APIs. +// https://github.com/rust-lang/rust/issues/130323 +#![cfg_attr(all(target_os = "wasi", target_env = "p2"), feature(wasip2))] //! Temporary files and directories. //! //! - Use the [`tempfile()`] function for temporary files