From 09bfb98b00a86d2e4a53d4758f4e91f503b07044 Mon Sep 17 00:00:00 2001 From: Christopher Smyth Date: Thu, 4 Apr 2024 15:32:42 -0400 Subject: [PATCH] Fix nightly (#169) * Fix nightly lint causing compilation to fail * Relax checks on unused imports This is definitely worth a warning but should not make builds fail for users. We deny warnings in CI and sort this out before integrating. See issue #169 for more details. * Don't let nightly builds fail CI * Clean up superfluous explicit import Current nightly considers use nix::self as an unused import as nix is already through the extern prelude (since edition 2018) and generates a warning. Remove the explicit import to silence it. See: * Output of 'cargo --verbose check' * https://doc.rust-lang.org/stable/reference/names/preludes.html#extern-prelude --------- Co-authored-by: Ross Smyth Co-authored-by: Christian Meusel --- .github/workflows/build.yaml | 6 ++++++ .github/workflows/ci.yaml | 28 ++++++++++++++++++++++++++++ src/lib.rs | 4 +--- src/posix/tty.rs | 2 +- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6a0dd531..ea08181d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,6 +18,9 @@ on: toolchain: default: stable type: string + continue-on-error: + default: false + type: boolean env: # While we could define these on a per-job basis, there's no harm in simply @@ -46,10 +49,13 @@ env: CARGO_TERM_COLOR: always # Enable cross compilation for `pkg_config`. PKG_CONFIG_ALLOW_CROSS: 1 + # Deny warnings. + RUSTFLAGS: -D warnings jobs: build: runs-on: ${{ inputs.runs_on }} + continue-on-error: ${{ inputs.continue-on-error }} steps: - name: Build | install dependencies if: inputs.runs_on == 'ubuntu-latest' diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ccacede3..e488faab 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -244,3 +244,31 @@ jobs: disable_extra_builds: true disable_tests: true target: x86_64-unknown-netbsd + + # -------------------------------------------------------------------------- + # NIGHTLY BUILD + + aarch64-apple-darwin-nightly: + uses: ./.github/workflows/build.yaml + with: + continue-on-error: true + disable_tests: true + runs_on: macos-latest + target: aarch64-apple-darwin + toolchain: nightly + + x86_64-pc-windows-msvc-nightly: + uses: ./.github/workflows/build.yaml + with: + continue-on-error: true + runs_on: windows-2019 + target: x86_64-pc-windows-msvc + toolchain: nightly + + x86_64-unknown-linux-gnu-nightly: + uses: ./.github/workflows/build.yaml + with: + continue-on-error: true + extra_packages: libudev-dev + target: x86_64-unknown-linux-gnu + toolchain: nightly diff --git a/src/lib.rs b/src/lib.rs index f369c41c..f01363dc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,8 +19,7 @@ #![deny( missing_docs, missing_debug_implementations, - missing_copy_implementations, - unused + missing_copy_implementations )] // Document feature-gated elements on docs.rs. See // https://doc.rust-lang.org/rustdoc/unstable-features.html?highlight=doc(cfg#doccfg-recording-what-platforms-or-features-are-required-for-code-to-be-present @@ -32,7 +31,6 @@ // doc tests. #![doc(test(attr(allow(unused_must_use))))] -use std::convert::From; use std::error::Error as StdError; use std::fmt; use std::io; diff --git a/src/posix/tty.rs b/src/posix/tty.rs index c21cf2d1..e29a8a85 100644 --- a/src/posix/tty.rs +++ b/src/posix/tty.rs @@ -5,7 +5,7 @@ use std::time::Duration; use std::{io, mem}; use nix::fcntl::{fcntl, OFlag}; -use nix::{self, libc, unistd}; +use nix::{libc, unistd}; use crate::posix::ioctl::{self, SerialLines}; use crate::posix::termios;