docs(hid): stop linking a cfg-gated type so rustdoc passes on Windows - #661
docs(hid): stop linking a cfg-gated type so rustdoc passes on Windows#661yuzi-co wants to merge 1 commit into
Conversation
transport.rs's module doc linked `AsyncHidChannel::supports_short_long_hidpp`, but `AsyncHidChannel` is `cfg(not(target_os = "windows"))`. On Windows the link cannot resolve, and lib.rs denies `rustdoc::broken_intra_doc_links`, so `cargo doc -p openlogi-hid` fails the whole crate there. CI never sees it: the `rustdoc (hid crates)` job runs only on ubuntu-latest. The cost lands on contributors instead — AGENTS.md makes the four-command local gate a hard stop before pushing, and its rustdoc step cannot pass on a Windows checkout of master. Name the type in plain backticks instead, which is already how node_ledger.rs refers to it, and say why inline so the link does not come back. Gate on Windows after this change: fmt, clippy, test, and rustdoc all clean.
Greptile SummaryThis PR fixes Windows rustdoc generation by replacing an intra-doc link to a non-Windows-only type with plain code formatting.
Confidence Score: 5/5The PR appears safe to merge because it makes a documentation-only correction that avoids the cfg-gated Windows rustdoc failure. The changed reference no longer requires rustdoc to resolve a type excluded on Windows, while the surrounding documentation and runtime code remain unchanged.
|
| Filename | Overview |
|---|---|
| crates/openlogi-hid/src/transport.rs | Replaces a platform-invalid rustdoc link with plain code formatting and records the cfg-related rationale; no issues found. |
Reviews (1): Last reviewed commit: "docs(hid): stop linking a cfg-gated type..." | Re-trigger Greptile
|
Closing — master fixed this independently, and better. This PR escaped the link to plain backticks so Two things landed since this branch was cut:
Verified on master at Rebasing this would have meant reapplying a workaround to a problem that no longer exists, against a file that has moved. The same bug is still live in another crate
That reproduces on unmodified master, and CI never catches it because the rustdoc job runs on Linux. Same failure mode this PR was written for, one crate over. Noting it here so it is on record; not fixing it in this PR. |
crates/openlogi-hid/src/transport.rs's module doc linksAsyncHidChannel::supports_short_long_hidpp, but the type is declared#[cfg(not(target_os = "windows"))](transport.rs:435). On Windows the link has no target,lib.rs:11deniesrustdoc::broken_intra_doc_links, and the whole crate's docs fail to build:Why CI is green anyway
ci.yml'srustdoc (hid crates)job runs onubuntu-latestonly, where the type exists and the link resolves. The latest master run (822c6e41) reports that job assuccess, and it is not wrong — the break is invisible from Linux.Why it still matters
The cost lands on contributors rather than CI.
AGENTS.mdmakes the four-command local gate a hard stop:On a Windows checkout of unmodified master, step four exits 101. Following the documented process to the letter is impossible, so the honest options are to skip the mandated step or to stop. That is a bad first experience for exactly the platform the README calls the young port.
It is also the failure mode
AGENTS.mditself warns about at length under "Platform / cfg-gated code (macOS-green is a trap)" — same class, just with Linux as the green platform this time.Fix
Name the type in plain backticks rather than linking it. That is already how
node_ledger.rsrefers toAsyncHidChannel(lines 5 and 37) — this module doc was the lone outlier — and a short note inline records why, so the link does not get "helpfully" restored later.No behaviour change; docs text only.
Verification
Full gate from
AGENTS.md, run on Windows 11 x86_64 (rustc 1.97.1) on the commit being pushed:Before the change, that fourth command exits 101 on the same machine against clean master; I confirmed that by stashing the diff and re-running.