Skip to content

Commit 74ae36c

Browse files
klutzyalexcrichton
authored andcommitted
compiletest: Fix bitrotted win32 routines
1 parent 696a005 commit 74ae36c

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/compiletest/procsrv.rs

+12-10
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,25 @@ use std::str;
1313
use std::io::process::{ProcessExit, Process, ProcessConfig, ProcessOutput};
1414

1515
#[cfg(target_os = "win32")]
16-
fn target_env(lib_path: &str, prog: &str) -> Vec<(~str,~str)> {
17-
18-
let mut env = os::env();
16+
fn target_env(lib_path: &str, prog: &str) -> Vec<(~str, ~str)> {
17+
let env = os::env();
1918

2019
// Make sure we include the aux directory in the path
2120
assert!(prog.ends_with(".exe"));
2221
let aux_path = prog.slice(0u, prog.len() - 4u).to_owned() + ".libaux";
2322

24-
env = env.map(|pair| {
25-
let (k,v) = (*pair).clone();
26-
if k == ~"PATH" { (~"PATH", v + ";" + lib_path + ";" + aux_path) }
27-
else { (k,v) }
28-
});
23+
let mut new_env: Vec<_> = env.move_iter().map(|(k, v)| {
24+
let new_v = if "PATH" == k {
25+
format!("{};{};{}", v, lib_path, aux_path)
26+
} else {
27+
v
28+
};
29+
(k, new_v)
30+
}).collect();
2931
if prog.ends_with("rustc.exe") {
30-
env.push((~"RUST_THREADS", ~"1"));
32+
new_env.push((~"RUST_THREADS", ~"1"));
3133
}
32-
return env;
34+
return new_env;
3335
}
3436

3537
#[cfg(target_os = "linux")]

src/compiletest/runtest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
529529
c
530530
}
531531
} ).collect();
532-
str::from_chars( c )
532+
str::from_chars(c.as_slice())
533533
}
534534
535535
#[cfg(target_os = "win32")]

0 commit comments

Comments
 (0)