about summary refs log tree commit diff
path: root/src/libextra/workcache.rs
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2013-09-26 17:21:59 -0700
committerKevin Ballard <kevin@sb.org>2013-10-15 21:56:54 -0700
commit73d3d00ec437f87ac665b4e4da3bedec8ce4f9ef (patch)
tree7050b2b93e3c58d7766e9aecd7e973ea88d9210e /src/libextra/workcache.rs
parent6741241f4046aea4014b1a23618593fb481c8606 (diff)
downloadrust-73d3d00ec437f87ac665b4e4da3bedec8ce4f9ef.tar.gz
rust-73d3d00ec437f87ac665b4e4da3bedec8ce4f9ef.zip
path2: Replace the path module outright
Remove the old path.
Rename path2 to path.
Update all clients for the new path.

Also make some miscellaneous changes to the Path APIs to help the
adoption process.
Diffstat (limited to 'src/libextra/workcache.rs')
-rw-r--r--src/libextra/workcache.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs
index 32a2d83d814..ea943cdb01b 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_str(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()
         }
     };