From d543d8eabdb3ba106f7381f40874d067dc0a7f05 Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 6 May 2024 10:31:19 +0900 Subject: [PATCH 1/4] chore: fix unexpected cfg warning --- build.rs | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 build.rs diff --git a/build.rs b/build.rs new file mode 100644 index 0000000000..21f3ce6263 --- /dev/null +++ b/build.rs @@ -0,0 +1,4 @@ +fn main() { + println!("cargo:rustc-check-cfg=cfg(hyper_unstable_ffi)"); + println!("cargo:rustc-check-cfg=cfg(hyper_unstable_tracing)"); +} From 0ca1dc69c50bd7760d2423bb4860f1b2a80fa3e4 Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 6 May 2024 11:16:57 +0900 Subject: [PATCH 2/4] Revert "chore: fix unexpected cfg warning" This reverts commit d543d8eabdb3ba106f7381f40874d067dc0a7f05. --- build.rs | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 build.rs diff --git a/build.rs b/build.rs deleted file mode 100644 index 21f3ce6263..0000000000 --- a/build.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - println!("cargo:rustc-check-cfg=cfg(hyper_unstable_ffi)"); - println!("cargo:rustc-check-cfg=cfg(hyper_unstable_tracing)"); -} From 9f8167f40fd9c560b62bdc6488ab12ec3372c5dd Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 6 May 2024 11:19:54 +0900 Subject: [PATCH 3/4] chore: allow unexpected_cfgs --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 23087a0efe..b2f5cccf81 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ #![deny(missing_docs)] #![deny(missing_debug_implementations)] +#![allow(unexpected_cfgs)] #![cfg_attr(test, deny(rust_2018_idioms))] #![cfg_attr(all(test, feature = "full"), deny(unreachable_pub))] #![cfg_attr(all(test, feature = "full"), deny(warnings))] From 51b2fca4900c1187eb42707e027dcc87216ed524 Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 8 May 2024 18:39:24 +0900 Subject: [PATCH 4/4] chore: fix unexpected cfg warning --- .github/workflows/CI.yml | 17 +++++++++++++++++ src/lib.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bd03dbaff3..fa765ae9b7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -23,6 +23,7 @@ jobs: - features - ffi - ffi-header + - unexpected-cfgs - doc - check-external-types - udeps @@ -220,6 +221,22 @@ jobs: - name: Ensure that hyper.h is up to date run: ./capi/gen_header.sh --verify + unexpected-cfgs: + runs-on: ubuntu-latest + needs: [style] + 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 hyper_internal_check_unexpected_cfgs + --cfg hyper_unstable_tracing + --cfg hyper_unstable_ffi + --check-cfg=cfg(hyper_internal_check_unexpected_cfgs,hyper_unstable_tracing,hyper_unstable_ffi) + doc: name: Build docs needs: [style, test] diff --git a/src/lib.rs b/src/lib.rs index b2f5cccf81..0e734aa551 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ #![deny(missing_docs)] #![deny(missing_debug_implementations)] -#![allow(unexpected_cfgs)] +#![cfg_attr(not(hyper_internal_check_unexpected_cfgs), allow(unexpected_cfgs))] #![cfg_attr(test, deny(rust_2018_idioms))] #![cfg_attr(all(test, feature = "full"), deny(unreachable_pub))] #![cfg_attr(all(test, feature = "full"), deny(warnings))]