Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/compiletest/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ pub fn parse_config(args: ~[~str]) -> config {
}

fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
Path::init(m.opt_str(nm).unwrap())
Path::new(m.opt_str(nm).unwrap())
}

config {
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
rustc_path: opt_path(matches, "rustc-path"),
clang_path: matches.opt_str("clang-path").map(|s| Path::init(s)),
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path::init(s)),
clang_path: matches.opt_str("clang-path").map(|s| Path::new(s)),
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path::new(s)),
src_base: opt_path(matches, "src-base"),
build_base: opt_path(matches, "build-base"),
aux_base: opt_path(matches, "aux-base"),
Expand All @@ -124,10 +124,10 @@ pub fn parse_config(args: ~[~str]) -> config {
} else {
None
},
logfile: matches.opt_str("logfile").map(|s| Path::init(s)),
save_metrics: matches.opt_str("save-metrics").map(|s| Path::init(s)),
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
save_metrics: matches.opt_str("save-metrics").map(|s| Path::new(s)),
ratchet_metrics:
matches.opt_str("ratchet-metrics").map(|s| Path::init(s)),
matches.opt_str("ratchet-metrics").map(|s| Path::new(s)),
ratchet_noise_percent:
matches.opt_str("ratchet-noise-percent").and_then(|s| from_str::<f64>(s)),
runtool: matches.opt_str("runtool"),
Expand Down
4 changes: 2 additions & 2 deletions src/compiletest/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ fn parse_exec_env(line: &str) -> Option<(~str, ~str)> {

fn parse_pp_exact(line: &str, testfile: &Path) -> Option<Path> {
match parse_name_value_directive(line, ~"pp-exact") {
Some(s) => Some(Path::init(s)),
Some(s) => Some(Path::new(s)),
None => {
if parse_name_directive(line, "pp-exact") {
testfile.filename().map(|s| Path::init(s))
testfile.filename().map(|s| Path::new(s))
} else {
None
}
Expand Down
4 changes: 2 additions & 2 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn run_metrics(config: config, testfile: ~str, mm: &mut MetricMap) {
// We're going to be dumping a lot of info. Start on a new line.
print!("\n\n");
}
let testfile = Path::init(testfile);
let testfile = Path::new(testfile);
debug!("running {}", testfile.display());
let props = load_props(&testfile);
debug!("loaded props");
Expand Down Expand Up @@ -852,7 +852,7 @@ fn aux_output_dir_name(config: &config, testfile: &Path) -> Path {
}

fn output_testname(testfile: &Path) -> Path {
Path::init(testfile.filestem().unwrap())
Path::new(testfile.filestem().unwrap())
}

fn output_base_name(config: &config, testfile: &Path) -> Path {
Expand Down
6 changes: 3 additions & 3 deletions src/libextra/glob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub fn glob_with(pattern: &str, options: MatchOptions) -> GlobIterator {

// calculate root this way to handle volume-relative Windows paths correctly
let mut root = os::getcwd();
let pat_root = Path::init(pattern).root_path();
let pat_root = Path::new(pattern).root_path();
if pat_root.is_some() {
if check_windows_verbatim(pat_root.get_ref()) {
// XXX: How do we want to handle verbatim paths? I'm inclined to return nothing,
Expand Down Expand Up @@ -766,9 +766,9 @@ mod test {

#[test]
fn test_matches_path() {
// on windows, (Path::init("a/b").as_str().unwrap() == "a\\b"), so this
// on windows, (Path::new("a/b").as_str().unwrap() == "a\\b"), so this
// tests that / and \ are considered equivalent on windows
assert!(Pattern::new("a/b").matches_path(&Path::init("a/b")));
assert!(Pattern::new("a/b").matches_path(&Path::new("a/b")));
}
}

Loading