rename the dep-graph file to include crate ident

This way, multiple compilations can share the same work directory.
This commit is contained in:
Niko Matsakis 2016-04-06 12:01:40 -04:00
parent ef902a211b
commit bc02a54d12

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use rustc::middle::cstore::LOCAL_CRATE;
use rustc::ty::TyCtxt;
use std::fs;
@ -28,7 +29,12 @@ pub fn dep_graph_path(tcx: TyCtxt) -> Option<PathBuf> {
}
}
Some(incr_dir.join("dep_graph.rbml"))
let crate_name = tcx.crate_name(LOCAL_CRATE);
let crate_disambiguator = tcx.crate_disambiguator(LOCAL_CRATE);
let file_name = format!("dep-graph-{}-{}.bin",
crate_name,
crate_disambiguator);
Some(incr_dir.join(file_name))
})
}