From a73c6f24e97b515a8007e4d9313b11de1dde948c Mon Sep 17 00:00:00 2001 From: dswij Date: Wed, 8 May 2024 23:03:05 +0800 Subject: [PATCH] fix unexpected cfg on nightly --- .github/workflows/ci.yml | 12 ++++++++++++ src/lib.rs | 1 + 2 files changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5aa58b1d4..90aa511d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -165,6 +165,17 @@ jobs: run: rustup component add rust-src - name: Run tests with sanitizer run: make test_sanitizer SAN=${{ matrix.sanitizer }} + UnexpectedCfgs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 + - run: cargo check --all-features + env: + RUSTFLAGS: >- + -D unexpected_cfgs + --cfg internal_check_unexpected_cfgs # Single job required to merge the pr. Passed: runs-on: ubuntu-latest @@ -179,5 +190,6 @@ jobs: - Rustfmt - CheckTargets - CheckTier3Targets + - UnexpectedCfgs steps: - run: exit 0 diff --git a/src/lib.rs b/src/lib.rs index 8004ee2bb..cf09873cf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,7 @@ unused_imports, dead_code )] +#![cfg_attr(internal_check_unexpected_cfgs, allow(unexpected_cfgs))] #![cfg_attr(docsrs, feature(doc_cfg))] // Disallow warnings when running tests. #![cfg_attr(test, deny(warnings))]