Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a directory for --out-dir if it does not already exist #47854

Merged
merged 1 commit into from
Feb 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ pub fn compile_input(trans: Box<TransCrate>,
return Ok(())
}

if let &Some(ref dir) = outdir {
if fs::create_dir_all(dir).is_err() {
sess.err("failed to find or create the directory specified by --out-dir");
return Err(CompileIncomplete::Stopped);
}
}

let arenas = AllArenas::new();

// Construct the HIR map
Expand Down