From 2cfcca471e614253172f790dee2d4f64ffe7dd47 Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Sun, 3 May 2026 08:43:52 -0500 Subject: [PATCH] fix(truncate): drop dead Windows stub for filetime_set_modified The previous commit gated `prune_older_than_keeps_fresh_files_drops_stale_ones` on `#[cfg(unix)]` because the mtime-backdate helper relies on `utimensat`, which doesn't exist on Windows. That left the `#[cfg(not(unix))]` stub of `filetime_set_modified` with zero callers on Windows, and `-D dead-code` (implied by `-D warnings`) refused to compile the test binary on Windows runners. Drop the Windows stub entirely. The `cfg(unix)` test is the only caller; `cfg(not(unix))` builds need nothing in its place. Restores PR #519 Windows CI to green. --- crates/tui/src/tools/truncate.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/tui/src/tools/truncate.rs b/crates/tui/src/tools/truncate.rs index ff1a52dd..59a15d94 100644 --- a/crates/tui/src/tools/truncate.rs +++ b/crates/tui/src/tools/truncate.rs @@ -478,11 +478,12 @@ mod tests { ); } - #[cfg(not(unix))] - fn filetime_set_modified(_path: &Path, _when: SystemTime) { - // Not exercised in CI on Windows; prune semantics are the same - // and the per-cycle stress test lives on the Unix path. - } + // Windows stub removed in v0.8.8 — the only caller of + // `filetime_set_modified` is `prune_older_than_keeps_fresh_files_drops_stale_ones`, + // which is now `#[cfg(unix)]` because mtime backdating requires + // `utimensat` and a Windows no-op stub can't make the assertion pass + // anyway. Keeping the stub triggered `-D dead-code` on Windows builds + // (the prune test was the only caller) and broke `Test (windows-latest)`. #[test] fn apply_spillover_is_noop_below_threshold() {