Skip to content

Commit

Permalink
Fix nightly (#169)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Christian Meusel <[email protected]>
  • Loading branch information
3 people authored Apr 4, 2024
1 parent 361664b commit 09bfb98
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/posix/tty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 09bfb98

Please sign in to comment.