Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cargo hack warnings #3114

Merged
merged 6 commits into from
Dec 27, 2024
Merged

Fix cargo hack warnings #3114

merged 6 commits into from
Dec 27, 2024

Conversation

Turbo87
Copy link
Collaborator

@Turbo87 Turbo87 commented Dec 27, 2024

I noticed that the cargo hack CI job was showing several warnings for certain feature combinations. This PR fixes these issues and adjusts the CI workflow to fail the build for cargo hack warnings in the future to prevent this from regressing.

This seems unrelated to "request parts", so let's give it a more reasonable name.
This fixes a compiler warning when used with `--no-default-features`
This fixes a compiler warning when used with `--no-default-features`
…cros are not used

This fixes a compiler warning when used with `--no-default-features`
@@ -0,0 +1,85 @@
use super::{Extension, FromRequestParts};
use http::{request::Parts, Uri};
use std::convert::Infallible;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in this case cargo hack complained about Infallible being unused without the original-uri feature. this was caused by the request_parts module being compiled in unconditionally and the cfg(feature) attributes being applied to each thing in this module individually.

I've extracted the OriginalUri implementation into a dedicated module and applied the cfg(feature) attribute to the mod original_uri declaration to avoid this issue, which is why the diff for this fix is a bit larger than the others.

@Turbo87 Turbo87 merged commit 32a948e into tokio-rs:main Dec 27, 2024
18 checks passed
@Turbo87 Turbo87 deleted the cfgs branch December 27, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants