diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39c90b7..ed54d2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: os: [ubuntu-latest, windows-latest] # When updating this, the reminder to update the minimum supported # Rust version in Cargo.toml. - rust: ['1.48'] + rust: ['1.63'] steps: - uses: actions/checkout@v3 - name: Install Rust diff --git a/Cargo.toml b/Cargo.toml index fd05bff..1da6bf1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ name = "async-process" version = "1.7.0" authors = ["Stjepan Glavina "] edition = "2018" -rust-version = "1.48" +rust-version = "1.63" description = "Async interface for working with processes" license = "Apache-2.0 OR MIT" repository = "https://github.com/smol-rs/async-process" @@ -20,9 +20,6 @@ cfg-if = "1.0" event-listener = "2.4.0" futures-lite = "1.11.0" -[build-dependencies] -autocfg = "1" - [target.'cfg(unix)'.dependencies] async-io = "1.8" rustix = { version = "0.37", default-features = false, features = ["std", "fs"] } diff --git a/build.rs b/build.rs deleted file mode 100644 index 6752846..0000000 --- a/build.rs +++ /dev/null @@ -1,19 +0,0 @@ -fn main() { - let cfg = match autocfg::AutoCfg::new() { - Ok(cfg) => cfg, - Err(e) => { - println!( - "cargo:warning=async-process: failed to detect compiler features: {}", - e - ); - return; - } - }; - - if !cfg.probe_rustc_version(1, 62) { - autocfg::emit("async_process_no_windows_raw_arg"); - } - if !cfg.probe_rustc_version(1, 63) { - autocfg::emit("async_process_no_io_safety"); - } -} diff --git a/src/lib.rs b/src/lib.rs index 0b7e59e..220b328 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,12 +60,10 @@ use std::thread; #[cfg(unix)] use async_io::Async; -#[cfg(all(not(async_process_no_io_safety), unix))] -use std::convert::{TryFrom, TryInto}; -#[cfg(all(not(async_process_no_io_safety), unix))] -use std::os::unix::io::{AsFd, BorrowedFd, OwnedFd}; #[cfg(unix)] -use std::os::unix::io::{AsRawFd, RawFd}; +use std::convert::{TryFrom, TryInto}; +#[cfg(unix)] +use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, OwnedFd, RawFd}; #[cfg(windows)] use blocking::Unblock; @@ -519,16 +517,14 @@ impl AsRawFd for ChildStdin { } } -/// **Note:** This implementation is only available on Rust 1.63+. -#[cfg(all(not(async_process_no_io_safety), unix))] +#[cfg(unix)] impl AsFd for ChildStdin { fn as_fd(&self) -> BorrowedFd<'_> { self.0.as_fd() } } -/// **Note:** This implementation is only available on Rust 1.63+. -#[cfg(all(not(async_process_no_io_safety), unix))] +#[cfg(unix)] impl TryFrom for OwnedFd { type Error = io::Error; @@ -605,16 +601,14 @@ impl AsRawFd for ChildStdout { } } -/// **Note:** This implementation is only available on Rust 1.63+. -#[cfg(all(not(async_process_no_io_safety), unix))] +#[cfg(unix)] impl AsFd for ChildStdout { fn as_fd(&self) -> BorrowedFd<'_> { self.0.as_fd() } } -/// **Note:** This implementation is only available on Rust 1.63+. -#[cfg(all(not(async_process_no_io_safety), unix))] +#[cfg(unix)] impl TryFrom for OwnedFd { type Error = io::Error; @@ -680,16 +674,14 @@ impl AsRawFd for ChildStderr { } } -/// **Note:** This implementation is only available on Rust 1.63+. -#[cfg(all(not(async_process_no_io_safety), unix))] +#[cfg(unix)] impl AsFd for ChildStderr { fn as_fd(&self) -> BorrowedFd<'_> { self.0.as_fd() } } -/// **Note:** This implementation is only available on Rust 1.63+. -#[cfg(all(not(async_process_no_io_safety), unix))] +#[cfg(unix)] impl TryFrom for OwnedFd { type Error = io::Error; diff --git a/src/windows.rs b/src/windows.rs index 453d3a5..020a290 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -1,6 +1,5 @@ //! Windows-specific extensions. -#[cfg(not(async_process_no_windows_raw_arg))] use std::ffi::OsStr; use std::os::windows::io::{AsRawHandle, RawHandle}; use std::os::windows::process::CommandExt as _; @@ -23,9 +22,6 @@ pub trait CommandExt: crate::sealed::Sealed { /// /// This is useful for passing arguments to `cmd.exe /c`, which doesn't follow /// `CommandLineToArgvW` escaping rules. - /// - /// **Note:** This method is only available on Rust 1.62+. - #[cfg(not(async_process_no_windows_raw_arg))] fn raw_arg>(&mut self, text_to_append_as_is: S) -> &mut Command; } @@ -36,7 +32,6 @@ impl CommandExt for Command { self } - #[cfg(not(async_process_no_windows_raw_arg))] fn raw_arg>(&mut self, text_to_append_as_is: S) -> &mut Command { self.inner.raw_arg(text_to_append_as_is); self