Skip to content

Commit b5bab85

Browse files
committed
auto merge of #10796 : kballard/rust/revert-new-naming, r=alexcrichton
Rename the `*::init()` functions back to `*::new()`, since `new` is not going to become a keyword.
2 parents 10c8409 + b170571 commit b5bab85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+627
-628
lines changed

src/compiletest/compiletest.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ pub fn parse_config(args: ~[~str]) -> config {
103103
}
104104

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

109109
config {
110110
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
111111
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
112112
rustc_path: opt_path(matches, "rustc-path"),
113-
clang_path: matches.opt_str("clang-path").map(|s| Path::init(s)),
114-
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path::init(s)),
113+
clang_path: matches.opt_str("clang-path").map(|s| Path::new(s)),
114+
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path::new(s)),
115115
src_base: opt_path(matches, "src-base"),
116116
build_base: opt_path(matches, "build-base"),
117117
aux_base: opt_path(matches, "aux-base"),
@@ -124,10 +124,10 @@ pub fn parse_config(args: ~[~str]) -> config {
124124
} else {
125125
None
126126
},
127-
logfile: matches.opt_str("logfile").map(|s| Path::init(s)),
128-
save_metrics: matches.opt_str("save-metrics").map(|s| Path::init(s)),
127+
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
128+
save_metrics: matches.opt_str("save-metrics").map(|s| Path::new(s)),
129129
ratchet_metrics:
130-
matches.opt_str("ratchet-metrics").map(|s| Path::init(s)),
130+
matches.opt_str("ratchet-metrics").map(|s| Path::new(s)),
131131
ratchet_noise_percent:
132132
matches.opt_str("ratchet-noise-percent").and_then(|s| from_str::<f64>(s)),
133133
runtool: matches.opt_str("runtool"),

src/compiletest/header.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ fn parse_exec_env(line: &str) -> Option<(~str, ~str)> {
160160

161161
fn parse_pp_exact(line: &str, testfile: &Path) -> Option<Path> {
162162
match parse_name_value_directive(line, ~"pp-exact") {
163-
Some(s) => Some(Path::init(s)),
163+
Some(s) => Some(Path::new(s)),
164164
None => {
165165
if parse_name_directive(line, "pp-exact") {
166-
testfile.filename().map(|s| Path::init(s))
166+
testfile.filename().map(|s| Path::new(s))
167167
} else {
168168
None
169169
}

src/compiletest/runtest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn run_metrics(config: config, testfile: ~str, mm: &mut MetricMap) {
4545
// We're going to be dumping a lot of info. Start on a new line.
4646
print!("\n\n");
4747
}
48-
let testfile = Path::init(testfile);
48+
let testfile = Path::new(testfile);
4949
debug!("running {}", testfile.display());
5050
let props = load_props(&testfile);
5151
debug!("loaded props");
@@ -852,7 +852,7 @@ fn aux_output_dir_name(config: &config, testfile: &Path) -> Path {
852852
}
853853

854854
fn output_testname(testfile: &Path) -> Path {
855-
Path::init(testfile.filestem().unwrap())
855+
Path::new(testfile.filestem().unwrap())
856856
}
857857

858858
fn output_base_name(config: &config, testfile: &Path) -> Path {

src/libextra/glob.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn glob_with(pattern: &str, options: MatchOptions) -> GlobIterator {
9090

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

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

0 commit comments

Comments
 (0)