about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/build_helper/lib.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/build_helper/lib.rs b/src/build_helper/lib.rs
index 97723e260f6..2b6e2828cfb 100644
--- a/src/build_helper/lib.rs
+++ b/src/build_helper/lib.rs
@@ -190,6 +190,9 @@ pub fn mtime(path: &Path) -> FileTime {
 ///
 /// Uses last-modified time checks to verify this.
 pub fn up_to_date(src: &Path, dst: &Path) -> bool {
+    if !dst.exists() {
+        return false;
+    }
     let threshold = mtime(dst);
     let meta = match fs::metadata(src) {
         Ok(meta) => meta,