diff options
| author | bors <bors@rust-lang.org> | 2013-10-16 11:26:35 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-10-16 11:26:35 -0700 |
| commit | 40180cdbea708307ca66dc6debddbd5ecc1ea41c (patch) | |
| tree | 0d26ddfa020874dc3f665c2c1d3e836ee729408b /src/libextra/workcache.rs | |
| parent | fabec998e5667d651d3475c12ee25ab97d21105c (diff) | |
| parent | d108a22fd1b38c108e2b9b6cd7276d953524ffa2 (diff) | |
| download | rust-40180cdbea708307ca66dc6debddbd5ecc1ea41c.tar.gz rust-40180cdbea708307ca66dc6debddbd5ecc1ea41c.zip | |
auto merge of #9655 : kballard/rust/path-rewrite, r=alexcrichton
Rewrite the entire `std::path` module from scratch. `PosixPath` is now based on `~[u8]`, which fixes #7225. Unnecessary allocation has been eliminated. There are a lot of clients of `Path` that still assume utf-8 paths. This is covered in #9639.
Diffstat (limited to 'src/libextra/workcache.rs')
| -rw-r--r-- | src/libextra/workcache.rs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs index 32a2d83d814..26309cf3b37 100644 --- a/src/libextra/workcache.rs +++ b/src/libextra/workcache.rs @@ -184,11 +184,11 @@ impl Database { let f = io::file_reader(&self.db_filename); match f { Err(e) => fail2!("Couldn't load workcache database {}: {}", - self.db_filename.to_str(), e.to_str()), + self.db_filename.display(), e.to_str()), Ok(r) => match json::from_reader(r) { Err(e) => fail2!("Couldn't parse workcache database (from file {}): {}", - self.db_filename.to_str(), e.to_str()), + self.db_filename.display(), e.to_str()), Ok(r) => { let mut decoder = json::Decoder(r); self.db_cache = Decodable::decode(&mut decoder); @@ -498,7 +498,7 @@ fn test() { // Create a path to a new file 'filename' in the directory in which // this test is running. fn make_path(filename: ~str) -> Path { - let pth = os::self_exe_path().expect("workcache::test failed").pop().push(filename); + let pth = os::self_exe_path().expect("workcache::test failed").with_filename(filename); if os::path_exists(&pth) { os::remove_file(&pth); } @@ -522,15 +522,20 @@ fn test() { let subcx = cx.clone(); let pth = pth.clone(); - prep.declare_input("file", pth.to_str(), digest_file(&pth)); + // FIXME (#9639): This needs to handle non-utf8 paths + prep.declare_input("file", pth.as_str().unwrap(), digest_file(&pth)); do prep.exec |_exe| { let out = make_path(~"foo.o"); - run::process_status("gcc", [pth.to_str(), ~"-o", out.to_str()]); + // FIXME (#9639): This needs to handle non-utf8 paths + run::process_status("gcc", [pth.as_str().unwrap().to_owned(), + ~"-o", + out.as_str().unwrap().to_owned()]); let _proof_of_concept = subcx.prep("subfn"); // Could run sub-rules inside here. - out.to_str() + // FIXME (#9639): This needs to handle non-utf8 paths + out.as_str().unwrap().to_owned() } }; |
