about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-11-22 15:45:12 -0800
committerPatrick Walton <pcwalton@mimiga.net>2013-11-29 10:55:13 -0800
commitc54427ddfbbab41a39d14f2b1dc4f080cbc2d41b (patch)
tree7b4e7af9dfe4342f3fd474f1010d4839281edd87 /src/librustc
parent6c672ee094a1a8e72c100100f43c73a9741f08a7 (diff)
downloadrust-c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b.tar.gz
rust-c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b.zip
libstd: Change `Path::new` to `Path::init`.
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/back/rpath.rs18
-rw-r--r--src/librustc/driver/driver.rs4
-rw-r--r--src/librustc/lib.rs6
-rw-r--r--src/librustc/metadata/creader.rs4
-rw-r--r--src/librustc/metadata/filesearch.rs4
5 files changed, 18 insertions, 18 deletions
diff --git a/src/librustc/back/rpath.rs b/src/librustc/back/rpath.rs
index eb332aeeb5c..5f01a57c23f 100644
--- a/src/librustc/back/rpath.rs
+++ b/src/librustc/back/rpath.rs
@@ -148,7 +148,7 @@ pub fn get_install_prefix_rpath(target_triple: &str) -> ~str {
     let install_prefix = env!("CFG_PREFIX");
 
     let tlib = filesearch::relative_target_lib_path(target_triple);
-    let mut path = Path::new(install_prefix);
+    let mut path = Path::init(install_prefix);
     path.push(&tlib);
     let path = os::make_absolute(&path);
     // FIXME (#9639): This needs to handle non-utf8 paths
@@ -183,7 +183,7 @@ mod test {
     #[test]
     fn test_prefix_rpath() {
         let res = get_install_prefix_rpath("triple");
-        let mut d = Path::new(env!("CFG_PREFIX"));
+        let mut d = Path::init(env!("CFG_PREFIX"));
         d.push("lib/rustc/triple/lib");
         debug!("test_prefix_path: {} vs. {}",
                res,
@@ -194,7 +194,7 @@ mod test {
     #[test]
     fn test_prefix_rpath_abs() {
         let res = get_install_prefix_rpath("triple");
-        assert!(Path::new(res).is_absolute());
+        assert!(Path::init(res).is_absolute());
     }
 
     #[test]
@@ -218,7 +218,7 @@ mod test {
     fn test_rpath_relative() {
       let o = abi::OsLinux;
       let res = get_rpath_relative_to_output(o,
-            &Path::new("bin/rustc"), &Path::new("lib/libstd.so"));
+            &Path::init("bin/rustc"), &Path::init("lib/libstd.so"));
       assert_eq!(res.as_slice(), "$ORIGIN/../lib");
     }
 
@@ -227,7 +227,7 @@ mod test {
     fn test_rpath_relative() {
         let o = abi::OsFreebsd;
         let res = get_rpath_relative_to_output(o,
-            &Path::new("bin/rustc"), &Path::new("lib/libstd.so"));
+            &Path::init("bin/rustc"), &Path::init("lib/libstd.so"));
         assert_eq!(res.as_slice(), "$ORIGIN/../lib");
     }
 
@@ -236,15 +236,15 @@ mod test {
     fn test_rpath_relative() {
         let o = abi::OsMacos;
         let res = get_rpath_relative_to_output(o,
-                                               &Path::new("bin/rustc"),
-                                               &Path::new("lib/libstd.so"));
+                                               &Path::init("bin/rustc"),
+                                               &Path::init("lib/libstd.so"));
         assert_eq!(res.as_slice(), "@loader_path/../lib");
     }
 
     #[test]
     fn test_get_absolute_rpath() {
-        let res = get_absolute_rpath(&Path::new("lib/libstd.so"));
-        let lib = os::make_absolute(&Path::new("lib"));
+        let res = get_absolute_rpath(&Path::init("lib/libstd.so"));
+        let lib = os::make_absolute(&Path::init("lib"));
         debug!("test_get_absolute_rpath: {} vs. {}",
                res.to_str(), lib.display());
 
diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs
index d8d868d8473..8821f5f6229 100644
--- a/src/librustc/driver/driver.rs
+++ b/src/librustc/driver/driver.rs
@@ -719,7 +719,7 @@ pub fn build_session_options(binary: @str,
         } else if matches.opt_present("emit-llvm") {
             link::output_type_bitcode
         } else { link::output_type_exe };
-    let sysroot_opt = matches.opt_str("sysroot").map(|m| @Path::new(m));
+    let sysroot_opt = matches.opt_str("sysroot").map(|m| @Path::init(m));
     let target = matches.opt_str("target").unwrap_or(host_triple());
     let target_cpu = matches.opt_str("target-cpu").unwrap_or(~"generic");
     let target_feature = matches.opt_str("target-feature").unwrap_or(~"");
@@ -753,7 +753,7 @@ pub fn build_session_options(binary: @str,
     let statik = debugging_opts & session::statik != 0;
 
     let addl_lib_search_paths = matches.opt_strs("L").map(|s| {
-      Path::new(s.as_slice())
+      Path::init(s.as_slice())
     }).move_iter().collect();
     let linker = matches.opt_str("linker");
     let linker_args = matches.opt_strs("link-args").flat_map( |a| {
diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs
index c65dc5cc50e..b5703a62a1f 100644
--- a/src/librustc/lib.rs
+++ b/src/librustc/lib.rs
@@ -248,7 +248,7 @@ pub fn run_compiler(args: &[~str], demitter: @diagnostic::Emitter) {
             let src = str::from_utf8(io::stdin().read_to_end());
             str_input(src.to_managed())
         } else {
-            file_input(Path::new(ifile))
+            file_input(Path::init(ifile))
         }
       }
       _ => early_error(demitter, "multiple input filenames provided")
@@ -256,8 +256,8 @@ pub fn run_compiler(args: &[~str], demitter: @diagnostic::Emitter) {
 
     let sopts = build_session_options(binary, matches, demitter);
     let sess = build_session(sopts, demitter);
-    let odir = matches.opt_str("out-dir").map(|o| Path::new(o));
-    let ofile = matches.opt_str("o").map(|o| Path::new(o));
+    let odir = matches.opt_str("out-dir").map(|o| Path::init(o));
+    let ofile = matches.opt_str("o").map(|o| Path::init(o));
     let cfg = build_configuration(sess);
     let pretty = matches.opt_default("pretty", "normal").map(|a| {
         parse_pretty(sess, a)
diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs
index e71db976283..f18357999a1 100644
--- a/src/librustc/metadata/creader.rs
+++ b/src/librustc/metadata/creader.rs
@@ -143,7 +143,7 @@ fn visit_view_item(e: @mut Env, i: &ast::view_item) {
           let meta_items = match path_opt {
               None => meta_items.clone(),
               Some((p, _path_str_style)) => {
-                  let p_path = Path::new(p);
+                  let p_path = Path::init(p);
                   match p_path.filestem_str() {
                       None|Some("") =>
                           e.diag.span_bug(i.span, "Bad package path in `extern mod` item"),
@@ -275,7 +275,7 @@ fn resolve_crate(e: @mut Env,
         };
         let (lident, ldata) = loader::load_library_crate(&load_ctxt);
 
-        let cfilename = Path::new(lident);
+        let cfilename = Path::init(lident);
         let cdata = ldata;
 
         let attrs = decoder::get_crate_attributes(cdata);
diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
index 456a08f6d08..0bd53eaa778 100644
--- a/src/librustc/metadata/filesearch.rs
+++ b/src/librustc/metadata/filesearch.rs
@@ -145,7 +145,7 @@ pub fn search(filesearch: @FileSearch, pick: pick) {
 
 pub fn relative_target_lib_path(target_triple: &str) -> Path {
     let dir = libdir();
-    let mut p = Path::new(dir.as_slice());
+    let mut p = Path::init(dir.as_slice());
     assert!(p.is_relative());
     p.push("rustc");
     p.push(target_triple);
@@ -199,7 +199,7 @@ pub fn rust_path() -> ~[Path] {
         Some(env_path) => {
             let env_path_components: ~[&str] =
                 env_path.split_str(PATH_ENTRY_SEPARATOR).collect();
-            env_path_components.map(|&s| Path::new(s))
+            env_path_components.map(|&s| Path::init(s))
         }
         None => ~[]
     };