diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2016-12-13 09:12:39 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2016-12-13 09:17:28 -0800 |
| commit | a1f5001998ad43ee6ce5a933be737ed63317916f (patch) | |
| tree | 3dd95e60114052037131f10b7f7c30d647152761 | |
| parent | 0d1b9f4614a086e92a81f45b46c73d5e4b6ad94d (diff) | |
| download | rust-a1f5001998ad43ee6ce5a933be737ed63317916f.tar.gz rust-a1f5001998ad43ee6ce5a933be737ed63317916f.zip | |
rustc: Use `create_dir_racy` in save analysis
The OSX bots failed last night due a race condition in save analysis where concurrent calls to `fs::create_dir_all` conflicted with one another. This replaces the relevant function call with `fs::create_dir_racy` which is defined internally to the compiler.
| -rw-r--r-- | src/librustc_save_analysis/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 0c910240b60..862345fd46e 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -48,7 +48,7 @@ use rustc::session::config::CrateType::CrateTypeExecutable; use rustc::ty::{self, TyCtxt}; use std::env; -use std::fs::{self, File}; +use std::fs::File; use std::path::{Path, PathBuf}; use syntax::ast::{self, NodeId, PatKind, Attribute, CRATE_NODE_ID}; @@ -832,7 +832,7 @@ pub fn process_crate<'l, 'tcx>(tcx: TyCtxt<'l, 'tcx, 'tcx>, }, }; - if let Err(e) = fs::create_dir_all(&root_path) { + if let Err(e) = rustc::util::fs::create_dir_racy(&root_path) { tcx.sess.err(&format!("Could not create directory {}: {}", root_path.display(), e)); |
