Bump MSRV to 1.63
This commit is contained in:
parent
5e48a40d6c
commit
7eb60b1025
|
@ -52,7 +52,7 @@ jobs:
|
||||||
os: [ubuntu-latest, windows-latest]
|
os: [ubuntu-latest, windows-latest]
|
||||||
# When updating this, the reminder to update the minimum supported
|
# When updating this, the reminder to update the minimum supported
|
||||||
# Rust version in Cargo.toml.
|
# Rust version in Cargo.toml.
|
||||||
rust: ['1.48']
|
rust: ['1.63']
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
|
|
|
@ -6,7 +6,7 @@ name = "async-process"
|
||||||
version = "1.7.0"
|
version = "1.7.0"
|
||||||
authors = ["Stjepan Glavina <stjepang@gmail.com>"]
|
authors = ["Stjepan Glavina <stjepang@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
rust-version = "1.48"
|
rust-version = "1.63"
|
||||||
description = "Async interface for working with processes"
|
description = "Async interface for working with processes"
|
||||||
license = "Apache-2.0 OR MIT"
|
license = "Apache-2.0 OR MIT"
|
||||||
repository = "https://github.com/smol-rs/async-process"
|
repository = "https://github.com/smol-rs/async-process"
|
||||||
|
@ -20,9 +20,6 @@ cfg-if = "1.0"
|
||||||
event-listener = "2.4.0"
|
event-listener = "2.4.0"
|
||||||
futures-lite = "1.11.0"
|
futures-lite = "1.11.0"
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
autocfg = "1"
|
|
||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
async-io = "1.8"
|
async-io = "1.8"
|
||||||
rustix = { version = "0.37", default-features = false, features = ["std", "fs"] }
|
rustix = { version = "0.37", default-features = false, features = ["std", "fs"] }
|
||||||
|
|
19
build.rs
19
build.rs
|
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
26
src/lib.rs
26
src/lib.rs
|
@ -60,12 +60,10 @@ use std::thread;
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use async_io::Async;
|
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)]
|
#[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)]
|
#[cfg(windows)]
|
||||||
use blocking::Unblock;
|
use blocking::Unblock;
|
||||||
|
@ -519,16 +517,14 @@ impl AsRawFd for ChildStdin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **Note:** This implementation is only available on Rust 1.63+.
|
#[cfg(unix)]
|
||||||
#[cfg(all(not(async_process_no_io_safety), unix))]
|
|
||||||
impl AsFd for ChildStdin {
|
impl AsFd for ChildStdin {
|
||||||
fn as_fd(&self) -> BorrowedFd<'_> {
|
fn as_fd(&self) -> BorrowedFd<'_> {
|
||||||
self.0.as_fd()
|
self.0.as_fd()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **Note:** This implementation is only available on Rust 1.63+.
|
#[cfg(unix)]
|
||||||
#[cfg(all(not(async_process_no_io_safety), unix))]
|
|
||||||
impl TryFrom<ChildStdin> for OwnedFd {
|
impl TryFrom<ChildStdin> for OwnedFd {
|
||||||
type Error = io::Error;
|
type Error = io::Error;
|
||||||
|
|
||||||
|
@ -605,16 +601,14 @@ impl AsRawFd for ChildStdout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **Note:** This implementation is only available on Rust 1.63+.
|
#[cfg(unix)]
|
||||||
#[cfg(all(not(async_process_no_io_safety), unix))]
|
|
||||||
impl AsFd for ChildStdout {
|
impl AsFd for ChildStdout {
|
||||||
fn as_fd(&self) -> BorrowedFd<'_> {
|
fn as_fd(&self) -> BorrowedFd<'_> {
|
||||||
self.0.as_fd()
|
self.0.as_fd()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **Note:** This implementation is only available on Rust 1.63+.
|
#[cfg(unix)]
|
||||||
#[cfg(all(not(async_process_no_io_safety), unix))]
|
|
||||||
impl TryFrom<ChildStdout> for OwnedFd {
|
impl TryFrom<ChildStdout> for OwnedFd {
|
||||||
type Error = io::Error;
|
type Error = io::Error;
|
||||||
|
|
||||||
|
@ -680,16 +674,14 @@ impl AsRawFd for ChildStderr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **Note:** This implementation is only available on Rust 1.63+.
|
#[cfg(unix)]
|
||||||
#[cfg(all(not(async_process_no_io_safety), unix))]
|
|
||||||
impl AsFd for ChildStderr {
|
impl AsFd for ChildStderr {
|
||||||
fn as_fd(&self) -> BorrowedFd<'_> {
|
fn as_fd(&self) -> BorrowedFd<'_> {
|
||||||
self.0.as_fd()
|
self.0.as_fd()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **Note:** This implementation is only available on Rust 1.63+.
|
#[cfg(unix)]
|
||||||
#[cfg(all(not(async_process_no_io_safety), unix))]
|
|
||||||
impl TryFrom<ChildStderr> for OwnedFd {
|
impl TryFrom<ChildStderr> for OwnedFd {
|
||||||
type Error = io::Error;
|
type Error = io::Error;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
//! Windows-specific extensions.
|
//! Windows-specific extensions.
|
||||||
|
|
||||||
#[cfg(not(async_process_no_windows_raw_arg))]
|
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::os::windows::io::{AsRawHandle, RawHandle};
|
use std::os::windows::io::{AsRawHandle, RawHandle};
|
||||||
use std::os::windows::process::CommandExt as _;
|
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
|
/// This is useful for passing arguments to `cmd.exe /c`, which doesn't follow
|
||||||
/// `CommandLineToArgvW` escaping rules.
|
/// `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;
|
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
|
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 {
|
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.inner.raw_arg(text_to_append_as_is);
|
||||||
self
|
self
|
||||||
|
|
Loading…
Reference in New Issue