Skip to content

tests/issue1794: cfg(unix)-gated helpers are dead code under RUSTFLAGS="-D warnings" on Windows #3772

Closed

Description

@caomengxuan666

Face

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

  1. added this to the 1.5.1 milestone on Nov 16, 2026
  2. added
    bug
    P3-low
    on Nov 16, 2026
  3. caomengxuan666 commented on Nov 16, 2026

    @caomengxuan666
    MemberAuthor

    开工:队长车道临时接手。工作区 ~/workspace/fix-3772/(base 70e962b),分支 fix/3772-issue1794-windows-dead-code。先在 X299-2607 上复现 RUSTFLAGS="-D warnings" cargo check --tests 报错(fail-first),再修后复验。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P3-lowbug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions