]> git.lizzy.rs Git - rust.git/commitdiff
rename the dep-graph file to include crate ident
authorNiko Matsakis <niko@alum.mit.edu>
Wed, 6 Apr 2016 16:01:40 +0000 (12:01 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 18 May 2016 14:11:35 +0000 (10:11 -0400)
This way, multiple compilations can share the same work directory.

src/librustc_incremental/persist/util.rs

index 8ebcbc0466f343238cb71edd05a141da0f991c19..754292ba38306036586ef172ccfa4ecc23e29d0e 100644 (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))
     })
 }