diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ccffb6..7c7e544 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -178,5 +178,5 @@ jobs: toolchain: ${{ matrix.rust }} - run: > rustup target add - wasm32-wasi - - run: cargo check --workspace --release -vv --target=wasm32-wasi + wasm32-wasip1 + - run: cargo check --workspace --release -vv --target=wasm32-wasip1 diff --git a/Cargo.toml b/Cargo.toml index a955360..ec8d906 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ rust-version = "1.63" os_pipe = { version = "1.0.0", features = ["io_safety"], optional = true } # Optionally depend on async-std just to provide impls for its types. -async-std = { version = "1.12.0", optional = true } +async-std = { version = "1.13.0", optional = true, features = ["io_safety"] } # Optionally depend on tokio to implement traits for its types. tokio = { version = "1.6.0", features = ["io-std", "fs", "net", "process"], optional = true } # Optionally depend on socket2 to implement traits for its types. @@ -30,13 +30,13 @@ socket2 = { version = "0.5.0", optional = true } mio = { version = "0.8.0", features = ["net", "os-ext"], optional = true } [target.'cfg(target_os = "hermit")'.dependencies] -hermit-abi = { version = "0.3", optional = true } +hermit-abi = { version = ">=0.3, <=0.4", optional = true } [target.'cfg(not(windows))'.dependencies] libc = { version = "0.2.96", optional = true } [target.'cfg(windows)'.dependencies.windows-sys] -version = "0.52.0" +version = ">=0.52, <=0.59" optional = true features = [ "Win32_Foundation", @@ -48,8 +48,13 @@ features = [ [package.metadata.docs.rs] features = ["close"] -rustdoc-args = ["--cfg", "doc_cfg"] [features] default = [] close = ["libc", "hermit-abi", "windows-sys"] + +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = [ + 'cfg(wasi_ext)', +] diff --git a/src/lib.rs b/src/lib.rs index f867ca4..b3a0cac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,7 +32,7 @@ #![cfg_attr(all(wasi_ext, target_os = "wasi"), feature(wasi_ext))] // Currently supported platforms. #![cfg(any(unix, windows, target_os = "wasi", target_os = "hermit"))] -#![cfg_attr(doc_cfg, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] mod portability; mod traits; @@ -133,7 +133,7 @@ pub use portability::{ }; #[cfg(feature = "close")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "close")))] +#[cfg_attr(docsrs, doc(cfg(feature = "close")))] pub mod example_ffi; pub mod raw; pub mod views; diff --git a/src/views.rs b/src/views.rs index 86315da..ffa8465 100644 --- a/src/views.rs +++ b/src/views.rs @@ -236,22 +236,22 @@ unsafe impl FilelikeViewType for os_pipe::PipeReader {} unsafe impl SocketlikeViewType for socket2::Socket {} #[cfg(not(any(target_os = "wasi", target_os = "hermit")))] -#[cfg(feature = "async_std")] +#[cfg(feature = "async-std")] unsafe impl SocketlikeViewType for async_std::net::TcpStream {} #[cfg(not(any(target_os = "wasi", target_os = "hermit")))] -#[cfg(feature = "async_std")] +#[cfg(feature = "async-std")] unsafe impl SocketlikeViewType for async_std::net::TcpListener {} #[cfg(not(any(target_os = "wasi", target_os = "hermit")))] -#[cfg(feature = "async_std")] +#[cfg(feature = "async-std")] unsafe impl SocketlikeViewType for async_std::net::UdpSocket {} #[cfg(unix)] -#[cfg(feature = "async_std")] +#[cfg(feature = "async-std")] unsafe impl SocketlikeViewType for async_std::os::unix::net::UnixStream {} #[cfg(unix)] -#[cfg(feature = "async_std")] +#[cfg(feature = "async-std")] unsafe impl SocketlikeViewType for async_std::os::unix::net::UnixListener {} #[cfg(unix)] -#[cfg(feature = "async_std")] +#[cfg(feature = "async-std")] unsafe impl SocketlikeViewType for async_std::os::unix::net::UnixDatagram {} #[cfg(feature = "mio")]