bug(ci): some warnings are not enforced by `features` step
維護者通常 1 天內回覆
@cratelyn 已經在處理了。
開始於 2026年10月13日。
評估
這個 Issue 還沒有評估資料。
描述
in https://github.com/hyperium/hyper/pull/4231, we noticed that the features step in the CI pipeline did not properly catch some warnings when running cargo hack against various feature combinations.
i tracked that down to a root cause of discrepancy between what warnings we enforce when running cargo test --features full, here:
Also since they can just be dropped immediately without triggering a warning, do
{}_span!macros not have#[must_use]?i was really curious about this as well. i think i figured this out:
first, i confirmed that
Enteredis marked with this attribute: https://docs.rs/tracing/0.1.44/src/tracing/span.rs.html#387and i was also able to confirm that a warning appears when building the errant commit
b236593bwith a nightly toolchain, with the tracing feature active.moreover, i even found that these did generate warnings in CI, here: https://github.com/hyperium/hyper/actions/runs/38023510701/job/114129390066#step:7:217
however, note the specific warnings we deny when running
cargo hack, here:- name: check --feature-powerset with tracing feature run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --features tracing --skip ffi env: RUSTFLAGS: "--cfg hyper_unstable_tracing -D dead_code -D unused_imports"...as compared to the compiler warning:
warning: unused `EnteredSpan` that must be used --> src/proto/h1/role.rs:86:5 | 86 | trace_span!("parse_headers"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: once a span has been entered, it should be exited = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default help: use `let _ = ...` to ignore the resulting value | 86 | let _ = trace_span!("parse_headers");; | +++++++ +we are only denying
dead\_codeandunused\_imports, and this is a separate linting rule.we don't enforce warnings as strictly when running
cargo hack, because we only deny warnings in tests here:// 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))]https://github.com/cratelyn/hyper/blob/b236593b60195dd25b53fefbb6b3f47b422b2db9/src/lib.rs#L4-L6
i think we can fix this easily, but i wanted to write this up here to (a) explain in-band why we didn't see a CI failure previously, and (b) act as a comment i can spin out into a separate issue.
thank you again for your thoughtful review, @/dswij, i appreciate it very much.
we should bring these into alignment. it can be somewhat abrasive to develop code in a feature that always enforces warnings however, so it would be nice to keep this blanket enforcement of all warnings cordoned off to specific builds in CI, as opposed promoting that to an unpredicated #![deny(warnings)].
- 主要語言
- Rust
- 星號
- 16.4k
- 分支
- 1.8k
- 平均合併
- 2 天 9 小時
- 30 天內合併 PR
- 14
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
hyperium/hyper 的其他 Issue
-
C-feature
難度 1/5 1 小時以內 新手友好度 65/100
hyperium/hyper#2652 · 4 個 reaction ·
維護者通常 1 天內回覆
-
Write a HIP for `Body::poll_progress()`可能已有人在做 @cratelyn 於 9 天前認領。 未關閉A-body B-rfc C-feature
hyperium/hyper#4228 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Upgraded HTTP/2 CONNECT streams cannot be reset, so a failed tunnel looks like a clean close可能已有人在做 @jeremyjpj0916 於 18 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 55/100
維護者通常 1 天內回覆
-
Allow connection pools to stop reusing an HTTP/2 connection before its keep-alive timeout可能已有人在做 @jiahaoliang 於 36 天前認領。 未關閉C-feature
難度 5/5 一週以上 新手友好度 35/100
維護者通常 1 天內回覆
-
HTTP/1 client connection is never closed or pooled when a response completes while the request body is still unsent ((Reading::KeepAlive, Writing::Body) is a terminal state)可能重新可做 @BlackRabbitCoder 於 32 天前認領,目前沒有進行中的 PR。 未關閉C-bug
hyperium/hyper#4176 · 6 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
相似的 Issue
-
priority: medium
難度 2/5 1-3 小時 新手友好度 68/100
storytold/photocraft#6759 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
-
area:logging documentation good first issue
難度 2/5 1-3 小時 新手友好度 72/100
hugowis/open-fpv-sim#48 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
IngvarConsulting/unica#1537 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100