Skip to content

Commit 65186e0

Browse files
committed
Gracefully exit when --keep-stage used on clean source tree
1 parent d6f0642 commit 65186e0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bootstrap/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,13 @@ impl Build {
14311431
return Vec::new();
14321432
}
14331433

1434+
if !stamp.exists() {
1435+
eprintln!(
1436+
"Warning: Unable to find the stamp file, did you try to keep a nonexistent build stage?"
1437+
);
1438+
crate::detail_exit(1);
1439+
}
1440+
14341441
let mut paths = Vec::new();
14351442
let contents = t!(fs::read(stamp), &stamp);
14361443
// This is the method we use for extracting paths from the stamp file passed to us. See

0 commit comments

Comments
 (0)