From 281999fcda25a8300b5fd5b2a12acdac8960168c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 9 Feb 2024 15:32:58 -0800 Subject: [PATCH] Fix compilation on Rust 1.63. (#37) Avoid using std::os::fd, which isn't available until Rust 1.66. And add Rust 1.63 testing in CI. --- .github/workflows/main.yml | 5 ++++- src/lib.rs | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b725abd..5e3ce94 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,8 +24,11 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - build: [stable, nightly] + build: [msrv, stable, nightly] include: + - build: msrv + os: ubuntu-latest + rust: 1.63 - build: stable os: ubuntu-latest rust: stable diff --git a/src/lib.rs b/src/lib.rs index 56c38cb..3ed4764 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,10 +36,12 @@ no_std )] -#[cfg(any(unix, target_os = "wasi"))] -use std::os::fd::{AsFd, AsRawFd}; #[cfg(target_os = "hermit")] use std::os::hermit::io::AsFd; +#[cfg(unix)] +use std::os::unix::io::{AsFd, AsRawFd}; +#[cfg(target_os = "wasi")] +use std::os::wasi::io::{AsFd, AsRawFd}; #[cfg(windows)] use std::os::windows::io::{AsHandle, AsRawHandle, BorrowedHandle}; #[cfg(windows)]