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))]