Skip to content

Commit

Permalink
handle unexpected_cfgs
Browse files Browse the repository at this point in the history
  • Loading branch information
dswij committed May 10, 2024
1 parent 309daae commit 6bce89e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ 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
--check-cfg=cfg(internal_check_unexpected_cfgs)
# Single job required to merge the pr.
Passed:
runs-on: ubuntu-latest
Expand All @@ -179,5 +191,6 @@ jobs:
- Rustfmt
- CheckTargets
- CheckTier3Targets
- UnexpectedCfgs
steps:
- run: exit 0
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
unused_imports,
dead_code
)]
#![cfg_attr(not(internal_check_unexpected_cfgs), allow(unexpected_cfgs))]
#![cfg_attr(docsrs, feature(doc_cfg))]
// Disallow warnings when running tests.
#![cfg_attr(test, deny(warnings))]
Expand Down

0 comments on commit 6bce89e

Please sign in to comment.