Skip to content

Commit c6f5f3f

Browse files
committed
fix(fingerprint): explicit reason than "stale; unknown reason"
This was discovered during playing with rmeta reuse between cargo-check and cargo-build
1 parent 64a1246 commit c6f5f3f

File tree

1 file changed

+4
-7
lines changed
  • src/cargo/core/compiler/fingerprint

1 file changed

+4
-7
lines changed

src/cargo/core/compiler/fingerprint/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,15 +1167,12 @@ impl Fingerprint {
11671167
// minimum mtime as it's the one we'll be comparing to inputs and
11681168
// dependencies.
11691169
for output in self.outputs.iter() {
1170-
let mtime = match paths::mtime(output) {
1171-
Ok(mtime) => mtime,
1172-
1170+
let Ok(mtime) = paths::mtime(output) else {
11731171
// This path failed to report its `mtime`. It probably doesn't
11741172
// exists, so leave ourselves as stale and bail out.
1175-
Err(e) => {
1176-
debug!("failed to get mtime of {:?}: {}", output, e);
1177-
return Ok(());
1178-
}
1173+
let item = StaleItem::FailedToReadMetadata(output.clone());
1174+
self.fs_status = FsStatus::StaleItem(item);
1175+
return Ok(());
11791176
};
11801177
assert!(mtimes.insert(output.clone(), mtime).is_none());
11811178
}

0 commit comments

Comments
 (0)