Repository navigation
Conversation
fixes #4232. in #4231, we found that we don't deny warnings when running cargo hack, because of the predicate that conditionally gates a crate-level `#![deny(warnings)]` attribute in `lib.rs`: ```rust // src/lib.rs #![cfg_attr(all(test, feature = "full"), deny(unreachable_pub))] #![cfg_attr(all(test, feature = "full"), deny(warnings))] #![cfg_attr(all(test, feature = "nightly"), feature(test))] ``` while this prevents warnings from existing when running `cargo test --features full`, it does not affect other builds. so, this would not be active in the commands run by the `features` step in CI, which runs the following two `cargo-hack` commands: ```sh RUSTFLAGS="-D dead_code -D unused_imports" \ cargo hack --no-dev-deps check \ --feature-powerset --depth 2 --skip ffi,tracing RUSTFLAGS="--cfg hyper_unstable_tracing -D dead_code -D unused_imports" \ cargo hack --no-dev-deps check \ --feature-powerset --depth 2 --features tracing --skip ffi ``` this commit introduces a new feature, intended for internal use in CI, called `__deny_warnings`. this provides another mechanism to deny warnings when building hyper. `cargo hack` invocations run in CI are updated to enable this flag. because `-D dead_code -D unused_imports` are now redundant, the `RUSTFLAGS` values passed to these steps are also accordingly simplified. Signed-off-by: katelyn martin <git@katelyn.world>
cratelyn
commented
Oct 30, 2026
Comment on lines
+4
to
+7
| #![cfg_attr( | ||
| any(all(test, feature = "full"), feature = "__deny_warnings"), | ||
| deny(warnings, unreachable_pub) | ||
| )] |
Member
Author
There was a problem hiding this comment.
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.
cratelyn
commented
Oct 30, 2026
| tracing = ["dep:tracing"] | ||
|
|
||
| # internal features used in CI | ||
| __deny_warnings = [] |
Member
Author
There was a problem hiding this comment.
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.
cratelyn
marked this pull request as ready for review
October 30, 2026 21:04
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #4232.
in #4231, we found that we don't deny warnings when running cargo hack,
because of the predicate that conditionally gates a crate-level
#![deny(warnings)]attribute inlib.rs:while this prevents warnings from existing when running
cargo test --features full, it does not affect other builds. so, this would not beactive in the commands run by the
featuresstep in CI, which runs thefollowing two
cargo-hackcommands:this commit introduces a new feature, intended for internal use in CI,
called
__deny_warnings. this provides another mechanism to denywarnings when building hyper.
cargo hackinvocations run in CI are updated to enable this flag.because
-D dead_code -D unused_importsare now redundant, theRUSTFLAGSvalues passed to these steps are also accordinglysimplified.
Signed-off-by: katelyn martin git@katelyn.world