about summary refs log tree commit diff
path: root/src/librustpkg/workcache_support.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/librustpkg/workcache_support.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/librustpkg/workcache_support.rs')
-rw-r--r--src/librustpkg/workcache_support.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/librustpkg/workcache_support.rs b/src/librustpkg/workcache_support.rs
index 8af24ff4c38..34404ad625c 100644
--- a/src/librustpkg/workcache_support.rs
+++ b/src/librustpkg/workcache_support.rs
@@ -30,7 +30,12 @@ pub fn digest_file_with_date(path: &Path) -> ~str {
             (*sha).input_str(st.st_mtime.to_str());
             (*sha).result_str()
         }
-        Err(e) => cond.raise((path.clone(), format!("Couldn't read file: {}", e))).to_str()
+        Err(e) => {
+            let path = cond.raise((path.clone(), format!("Couldn't read file: {}", e)));
+            // FIXME (#9639): This needs to handle non-utf8 paths
+            // XXX: I'm pretty sure this is the wrong return value
+            path.as_str().unwrap().to_owned()
+        }
     }
 }
 
@@ -51,13 +56,15 @@ pub fn digest_only_date(path: &Path) -> ~str {
 pub fn discover_outputs(e: &mut workcache::Exec, outputs: ~[Path]) {
     debug2!("Discovering {:?} outputs", outputs.len());
     for p in outputs.iter() {
-        debug2!("Discovering output! {}", p.to_str());
+        debug2!("Discovering output! {}", p.display());
         // For now, assume that all discovered outputs are binaries
-        e.discover_output("binary", p.to_str(), digest_only_date(p));
+        // FIXME (#9639): This needs to handle non-utf8 paths
+        e.discover_output("binary", p.as_str().unwrap(), digest_only_date(p));
     }
 }
 
 /// Returns the function name for building a crate
 pub fn crate_tag(p: &Path) -> ~str {
-    p.to_str() // implicitly, it's "build(p)"...
+    // FIXME (#9639): This needs to handle non-utf8 paths
+    p.as_str().unwrap().to_owned() // implicitly, it's "build(p)"...
 }