]>
git.proxmox.com Git - rustc.git/blob - src/librustc_incremental/persist/util.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 use std
::path
::PathBuf
;
15 pub fn dep_graph_path
<'tcx
>(tcx
: &ty
::TyCtxt
<'tcx
>) -> Option
<PathBuf
> {
16 // For now, just save/load dep-graph from
17 // directory/dep_graph.rbml
18 tcx
.sess
.opts
.incremental
.as_ref().and_then(|incr_dir
| {
19 match fs
::create_dir_all(&incr_dir
){
23 &format
!("could not create the directory `{}`: {}",
24 incr_dir
.display(), err
));
29 Some(incr_dir
.join("dep_graph.rbml"))