From ea9c4f0647e1c53abf81ce5ad25735549ef94faf Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Sun, 15 Jan 2023 00:10:45 +0000 Subject: [PATCH] Check for unknown features (#95) --- .github/workflows/features.yml | 26 ++++++++++++++++++++++++++ num_enum/tests/from_primitive.rs | 1 - num_enum/tests/into_primitive.rs | 1 - 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/features.yml diff --git a/.github/workflows/features.yml b/.github/workflows/features.yml new file mode 100644 index 0000000..7fadff2 --- /dev/null +++ b/.github/workflows/features.yml @@ -0,0 +1,26 @@ +name: Check for unknown features +on: + push: + branches: ["main"] + pull_request: +jobs: + unknown-features: + name: Check for unknown features + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v2 + - name: Fetch toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + - name: Check for unknown features + env: + RUSTFLAGS: "-D unexpected-cfgs" + uses: actions-rs/cargo@v1 + with: + command: check + args: -Z unstable-options -Z check-cfg=features --tests + toolchain: nightly diff --git a/num_enum/tests/from_primitive.rs b/num_enum/tests/from_primitive.rs index 32f23f0..2c72c6c 100644 --- a/num_enum/tests/from_primitive.rs +++ b/num_enum/tests/from_primitive.rs @@ -77,7 +77,6 @@ fn from_primitive_number() { } #[test] -#[cfg(feature = "nightly")] fn from_primitive_number_catch_all() { #[derive(Debug, Eq, PartialEq, FromPrimitive)] #[repr(u8)] diff --git a/num_enum/tests/into_primitive.rs b/num_enum/tests/into_primitive.rs index 9426714..a09bf56 100644 --- a/num_enum/tests/into_primitive.rs +++ b/num_enum/tests/into_primitive.rs @@ -27,7 +27,6 @@ fn simple() { } #[test] -#[cfg(feature = "nightly")] fn catch_all() { #[derive(Debug, Eq, PartialEq, IntoPrimitive)] #[repr(u8)]