From a2718217dca7bfcbb563337d53c3c1adea3321cc Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Wed, 13 Jul 2016 15:15:28 +0200 Subject: [PATCH] only remove directory if it exists --- src/bootstrap/doc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 247b9603c0b..c2636384dbb 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -181,7 +181,7 @@ pub fn rustc(build: &Build, stage: u32, target: &str, out: &Path) { let out_dir = build.stage_out(&compiler, Mode::Librustc) .join(target).join("doc"); let rustdoc = build.rustdoc(&compiler); - if !up_to_date(&rustdoc, &out_dir.join("rustc/index.html")) { + if !up_to_date(&rustdoc, &out_dir.join("rustc/index.html")) && out_dir.exists() { t!(fs::remove_dir_all(&out_dir)); } let mut cargo = build.cargo(&compiler, Mode::Librustc, target, "doc");