You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tests/issue1794: cfg(unix)-gated helpers are dead code under RUSTFLAGS="-D warnings" on Windows #3772
tests/issue1794_user_group_completion.rs fails a full-tree RUSTFLAGS="-D warnings" cargo check --tests on Windows: unused import std::path::PathBuf + dead function rubash.
Why (pre-existing, not a regression)
All four test fns (#[test] at lines 52/66/80/104) and the helper expected_candidates (line 35) are #[cfg(unix)]. On a Windows target the whole file's items are cfg'd out, so the top-level use std::path::PathBuf (line 15) and fn rubash (line 18) become unused/dead and -D warnings turns them into hard errors. Verified on base e1e3d7b (file untouched since); Linux legs are unaffected.
Found while reviewing PR #3768 (its own lib + pin faces pass -D warnings cleanly); the failure is unrelated to that PR.
Fix direction
Cfg-gate the import and the rubash helper with #[cfg(unix)] (or an equivalent allow), so the file compiles warning-free on all targets.
Destination
Test-hygiene wave, 1.5.1. No GNU divergence involved.
Activity
caomengxuan666 commentedon Nov 16, 2026
开工:队长车道临时接手。工作区
~/workspace/fix-3772/(base 70e962b),分支fix/3772-issue1794-windows-dead-code。先在 X299-2607 上复现RUSTFLAGS="-D warnings" cargo check --tests报错(fail-first),再修后复验。test: drop unused std::io::Write import in issue523 regressions (Refs #…
test: drop unused `use super::*` in issue3255 interactive mod (Refs #…
test: cfg-gate unix-only helpers in issue1794 test (Refs unixwin#3772) (