Skip to content

Commit 6bce89e

Browse files
committed
handle unexpected_cfgs
1 parent 309daae commit 6bce89e

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@ jobs:
165165
run: rustup component add rust-src
166166
- name: Run tests with sanitizer
167167
run: make test_sanitizer SAN=${{ matrix.sanitizer }}
168+
UnexpectedCfgs:
169+
runs-on: ubuntu-latest
170+
steps:
171+
- uses: actions/checkout@v4
172+
- uses: dtolnay/rust-toolchain@nightly
173+
- uses: Swatinem/rust-cache@v2
174+
- run: cargo check --all-features
175+
env:
176+
RUSTFLAGS: >-
177+
-D unexpected_cfgs
178+
--cfg internal_check_unexpected_cfgs
179+
--check-cfg=cfg(internal_check_unexpected_cfgs)
168180
# Single job required to merge the pr.
169181
Passed:
170182
runs-on: ubuntu-latest
@@ -179,5 +191,6 @@ jobs:
179191
- Rustfmt
180192
- CheckTargets
181193
- CheckTier3Targets
194+
- UnexpectedCfgs
182195
steps:
183196
- run: exit 0

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
unused_imports,
66
dead_code
77
)]
8+
#![cfg_attr(not(internal_check_unexpected_cfgs), allow(unexpected_cfgs))]
89
#![cfg_attr(docsrs, feature(doc_cfg))]
910
// Disallow warnings when running tests.
1011
#![cfg_attr(test, deny(warnings))]

0 commit comments

Comments
 (0)