diff --git a/.cirrus.yml b/.cirrus.yml index dbd0b15aca..522bdafcdb 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -9,7 +9,7 @@ env: RUSTFLAGS: -D warnings RUSTDOCFLAGS: -D warnings TOOL: cargo - MSRV: 1.63.0 + MSRV: 1.65.0 ZFLAGS: # Tests that don't require executing the build binaries @@ -137,7 +137,7 @@ task: - curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs - sh rustup.sh -y --profile=minimal --default-toolchain $MSRV - . $HOME/.cargo/env - - cargo install cross --version 0.2.1 # cross 0.2.2 bumped the MSRV to 1.58.1 + - cargo install cross --version 0.2.5 << : *TEST before_cache_script: rm -rf $CARGO_HOME/registry/index @@ -146,7 +146,7 @@ task: matrix: - name: Linux aarch64 arm_container: - image: rust:1.63.0 + image: rust:1.65.0 cpu: 1 depends_on: - FreeBSD 14 amd64 & i686 @@ -160,13 +160,13 @@ task: TARGET: aarch64-unknown-linux-gnu - name: Linux x86_64 container: - image: rust:1.63.0 + image: rust:1.65.0 cpu: 1 env: TARGET: x86_64-unknown-linux-gnu - name: Linux x86_64 musl container: - image: rust:1.63.0 + image: rust:1.65.0 cpu: 1 depends_on: - FreeBSD 14 amd64 & i686 @@ -199,7 +199,7 @@ task: # Tasks for cross-compiling, but no testing task: container: - image: rust:1.63.0 + image: rust:1.65.0 cpu: 1 depends_on: - FreeBSD 14 amd64 & i686 diff --git a/CHANGELOG.md b/CHANGELOG.md index 85bd94b2a3..7de03da0bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,8 +32,9 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Changed -- The MSRV is now 1.63 +- The MSRV is now 1.65 ([#1862](https://github.com/nix-rust/nix/pull/1862)) + ([#2104](https://github.com/nix-rust/nix/pull/2104)) - The epoll interface now uses a type. ([#1882](https://github.com/nix-rust/nix/pull/1882)) - With I/O-safe type applied in `pty::OpenptyResult` and `pty::ForkptyResult`, diff --git a/Cargo.toml b/Cargo.toml index 8cfd38fbc3..010c9f895b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "nix" description = "Rust friendly bindings to *nix APIs" edition = "2021" version = "0.26.1" -rust-version = "1.63" +rust-version = "1.65" authors = ["The nix-rust Project Developers"] repository = "https://github.com/nix-rust/nix" license = "MIT" diff --git a/README.md b/README.md index 3c528b6665..e172de2750 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ The following targets are supported by `nix`: ## Minimum Supported Rust Version (MSRV) -nix is supported on Rust 1.63 and higher. Its MSRV will not be +nix is supported on Rust 1.65 and higher. Its MSRV will not be changed in the future without bumping the major or minor version. ## Contributing diff --git a/src/sys/ioctl/linux.rs b/src/sys/ioctl/linux.rs index 669d517906..610b8ddac0 100644 --- a/src/sys/ioctl/linux.rs +++ b/src/sys/ioctl/linux.rs @@ -1,3 +1,5 @@ +use cfg_if::cfg_if; + /// The datatype used for the ioctl number #[cfg(any(target_os = "android", target_env = "musl"))] #[doc(hidden)] @@ -14,48 +16,41 @@ pub const NRBITS: ioctl_num_type = 8; #[doc(hidden)] pub const TYPEBITS: ioctl_num_type = 8; -#[cfg(any( - target_arch = "mips", - target_arch = "mips64", - target_arch = "powerpc", - target_arch = "powerpc64", - target_arch = "sparc64" -))] -mod consts { - #[doc(hidden)] - pub const NONE: u8 = 1; - #[doc(hidden)] - pub const READ: u8 = 2; - #[doc(hidden)] - pub const WRITE: u8 = 4; - #[doc(hidden)] - pub const SIZEBITS: u8 = 13; - #[doc(hidden)] - pub const DIRBITS: u8 = 3; -} - -// "Generic" ioctl protocol -#[cfg(any( - target_arch = "x86", - target_arch = "arm", - target_arch = "s390x", - target_arch = "x86_64", - target_arch = "aarch64", - target_arch = "riscv32", - target_arch = "riscv64", - target_arch = "loongarch64" -))] -mod consts { - #[doc(hidden)] - pub const NONE: u8 = 0; - #[doc(hidden)] - pub const READ: u8 = 2; - #[doc(hidden)] - pub const WRITE: u8 = 1; - #[doc(hidden)] - pub const SIZEBITS: u8 = 14; - #[doc(hidden)] - pub const DIRBITS: u8 = 2; +cfg_if! { + if #[cfg(any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "sparc64" + ))] { + mod consts { + #[doc(hidden)] + pub const NONE: u8 = 1; + #[doc(hidden)] + pub const READ: u8 = 2; + #[doc(hidden)] + pub const WRITE: u8 = 4; + #[doc(hidden)] + pub const SIZEBITS: u8 = 13; + #[doc(hidden)] + pub const DIRBITS: u8 = 3; + } + } else { + // "Generic" ioctl protocol + mod consts { + #[doc(hidden)] + pub const NONE: u8 = 0; + #[doc(hidden)] + pub const READ: u8 = 2; + #[doc(hidden)] + pub const WRITE: u8 = 1; + #[doc(hidden)] + pub const SIZEBITS: u8 = 14; + #[doc(hidden)] + pub const DIRBITS: u8 = 2; + } + } } pub use self::consts::*;