about summary refs log tree commit diff
path: root/src/libextra/workcache.rs
diff options
context:
space:
mode:
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..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()
         }
     };