about summary refs log tree commit diff
path: root/src/libstd/rt/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/rt/test.rs')
-rw-r--r--src/libstd/rt/test.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libstd/rt/test.rs b/src/libstd/rt/test.rs
index b6611eee9e6..1178bfdaa80 100644
--- a/src/libstd/rt/test.rs
+++ b/src/libstd/rt/test.rs
@@ -16,6 +16,7 @@ use container::Container;
 use iter::{Iterator, range};
 use super::io::net::ip::{SocketAddr, Ipv4Addr, Ipv6Addr};
 use vec::{OwnedVector, MutableVector, ImmutableVector};
+use path::GenericPath;
 use rt::sched::Scheduler;
 use unstable::{run_in_bare_thread};
 use rt::thread::Thread;
@@ -346,7 +347,6 @@ it is running in and assigns a port range based on it.
 fn base_port() -> uint {
     use os;
     use str::StrSlice;
-    use to_str::ToStr;
     use vec::ImmutableVector;
 
     let base = 9600u;
@@ -363,12 +363,14 @@ fn base_port() -> uint {
         ("dist", base + range * 8)
     ];
 
-    let path = os::getcwd().to_str();
+    // FIXME (#9639): This needs to handle non-utf8 paths
+    let path = os::getcwd();
+    let path_s = path.as_str().unwrap();
 
     let mut final_base = base;
 
     for &(dir, base) in bases.iter() {
-        if path.contains(dir) {
+        if path_s.contains(dir) {
             final_base = base;
             break;
         }