Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,12 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: check --feature-powerset
run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --skip ffi,tracing
env:
RUSTFLAGS: "-D dead_code -D unused_imports"
run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --features __deny_warnings --skip ffi,tracing

- name: check --feature-powerset with tracing feature
run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --features tracing --skip ffi
run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --features tracing,__deny_warnings --skip ffi
env:
RUSTFLAGS: "--cfg hyper_unstable_tracing -D dead_code -D unused_imports"
RUSTFLAGS: "--cfg hyper_unstable_tracing"

ffi:
name: Test C API (FFI)
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ capi = []
tracing = ["dep:tracing"]

# internal features used in CI
__deny_warnings = []

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i used two leading underscores in the name of this, following the convention set by previous feature flags like __internal_flaky_tests and __internal_happy_eyeballs_tests.

nightly = []

[lints.rust.unexpected_cfgs]
Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#![deny(missing_docs)]
#![deny(missing_debug_implementations)]
#![cfg_attr(test, deny(rust_2018_idioms))]
#![cfg_attr(all(test, feature = "full"), deny(unreachable_pub))]
#![cfg_attr(all(test, feature = "full"), deny(warnings))]
#![cfg_attr(
any(all(test, feature = "full"), feature = "__deny_warnings"),
deny(warnings, unreachable_pub)
)]
Comment on lines +4 to +7

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i preserved the existing all(test, feature = "full") predicate. i think that is probably worthwhile because it seems like a good ergonomic decision to have cargo test --features full continue to deny warnings, as a concise way to run tests and check for warnings when developing a feature.

#![cfg_attr(all(test, feature = "nightly"), feature(test))]
#![cfg_attr(docsrs, feature(doc_cfg))]

Expand Down
Loading