about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorteapot4195 <huangalex409@gmail.com>2023-01-28 15:20:27 -0500
committerteapot4195 <huangalex409@gmail.com>2023-01-28 15:20:27 -0500
commit65186e01285ba20e966e06f505f0e89e06694601 (patch)
treec59b61095051b60a04588bc4b5462607e08511a2 /src/bootstrap
parentd6f0642827e21a088b0130c84857d84f5433301d (diff)
Gracefully exit when --keep-stage used on clean source tree
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index d44b96cfb99..522b3b7e851 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -1431,6 +1431,13 @@ impl Build {
             return Vec::new();
         }
 
+        if !stamp.exists() {
+            eprintln!(
+                "Warning: Unable to find the stamp file, did you try to keep a nonexistent build stage?"
+            );
+            crate::detail_exit(1);
+        }
+
         let mut paths = Vec::new();
         let contents = t!(fs::read(stamp), &stamp);
         // This is the method we use for extracting paths from the stamp file passed to us. See