about summary refs log tree commit diff
path: root/src/libstd/rt/test.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-10-16 11:26:35 -0700
committerbors <bors@rust-lang.org>2013-10-16 11:26:35 -0700
commit40180cdbea708307ca66dc6debddbd5ecc1ea41c (patch)
tree0d26ddfa020874dc3f665c2c1d3e836ee729408b /src/libstd/rt/test.rs
parentfabec998e5667d651d3475c12ee25ab97d21105c (diff)
parentd108a22fd1b38c108e2b9b6cd7276d953524ffa2 (diff)
downloadrust-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/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;
         }