Bump MSRV to 1.63

This commit is contained in:
Taiki Endo 2023-06-11 13:20:50 +09:00
parent 5e48a40d6c
commit 7eb60b1025
5 changed files with 11 additions and 46 deletions

View File

@ -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

View File

@ -6,7 +6,7 @@ name = "async-process"
version = "1.7.0"
authors = ["Stjepan Glavina <stjepang@gmail.com>"]
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"] }

View File

@ -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");
}
}

View File

@ -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<ChildStdin> 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<ChildStdout> 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<ChildStderr> for OwnedFd {
type Error = io::Error;

View File

@ -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<S: AsRef<OsStr>>(&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<S: AsRef<OsStr>>(&mut self, text_to_append_as_is: S) -> &mut Command {
self.inner.raw_arg(text_to_append_as_is);
self