about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-12-04 23:26:19 -0800
committerbors <bors@rust-lang.org>2013-12-04 23:26:19 -0800
commitb5bab85c1a41bcd7758fb8090a3cf3ba20e33b48 (patch)
treeca9f9e55e2369c253cedd265d7273553370cfb8d /src/libsyntax
parent10c8409c786b8ee43c00fadfa1be6ebbfc846a91 (diff)
parentb1705714d5a13e9057db364b685c7cce7cc27982 (diff)
downloadrust-b5bab85c1a41bcd7758fb8090a3cf3ba20e33b48.tar.gz
rust-b5bab85c1a41bcd7758fb8090a3cf3ba20e33b48.zip
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.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/source_util.rs8
-rw-r--r--src/libsyntax/parse/mod.rs2
-rw-r--r--src/libsyntax/parse/parser.rs4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs
index 55f5490c8fb..c0c5c6c6c07 100644
--- a/src/libsyntax/ext/source_util.rs
+++ b/src/libsyntax/ext/source_util.rs
@@ -82,7 +82,7 @@ pub fn expand_include(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
     let file = get_single_str_from_tts(cx, sp, tts, "include!");
     let p = parse::new_sub_parser_from_file(
         cx.parse_sess(), cx.cfg(),
-        &res_rel_file(cx, sp, &Path::init(file)), sp);
+        &res_rel_file(cx, sp, &Path::new(file)), sp);
     base::MRExpr(p.parse_expr())
 }
 
@@ -90,7 +90,7 @@ pub fn expand_include(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
 pub fn expand_include_str(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
     -> base::MacResult {
     let file = get_single_str_from_tts(cx, sp, tts, "include_str!");
-    let file = res_rel_file(cx, sp, &Path::init(file));
+    let file = res_rel_file(cx, sp, &Path::new(file));
     let bytes = match io::result(|| File::open(&file).read_to_end()) {
         Err(e) => {
             cx.span_fatal(sp, format!("couldn't read {}: {}",
@@ -112,7 +112,7 @@ pub fn expand_include_bin(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
     use std::at_vec;
 
     let file = get_single_str_from_tts(cx, sp, tts, "include_bin!");
-    let file = res_rel_file(cx, sp, &Path::init(file));
+    let file = res_rel_file(cx, sp, &Path::new(file));
     match io::result(|| File::open(&file).read_to_end()) {
         Err(e) => {
             cx.span_fatal(sp, format!("couldn't read {}: {}",
@@ -156,7 +156,7 @@ fn topmost_expn_info(expn_info: @codemap::ExpnInfo) -> @codemap::ExpnInfo {
 fn res_rel_file(cx: @ExtCtxt, sp: codemap::Span, arg: &Path) -> Path {
     // NB: relative paths are resolved relative to the compilation unit
     if !arg.is_absolute() {
-        let mut cu = Path::init(cx.codemap().span_to_filename(sp));
+        let mut cu = Path::new(cx.codemap().span_to_filename(sp));
         cu.pop();
         cu.push(arg);
         cu
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs
index 83825cca631..612151f83e4 100644
--- a/src/libsyntax/parse/mod.rs
+++ b/src/libsyntax/parse/mod.rs
@@ -344,7 +344,7 @@ mod test {
     #[cfg(test)]
     fn to_json_str<'a, E: Encodable<extra::json::Encoder<'a>>>(val: &E) -> ~str {
         let mut writer = MemWriter::new();
-        let mut encoder = extra::json::Encoder::init(&mut writer as &mut io::Writer);
+        let mut encoder = extra::json::Encoder::new(&mut writer as &mut io::Writer);
         val.encode(&mut encoder);
         str::from_utf8_owned(writer.inner())
     }
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 4d0bda44fb6..8c4bf5d87ab 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -4232,10 +4232,10 @@ impl Parser {
                     outer_attrs: &[ast::Attribute],
                     id_sp: Span)
                     -> (ast::item_, ~[ast::Attribute]) {
-        let mut prefix = Path::init(self.sess.cm.span_to_filename(*self.span));
+        let mut prefix = Path::new(self.sess.cm.span_to_filename(*self.span));
         prefix.pop();
         let mod_path_stack = &*self.mod_path_stack;
-        let mod_path = Path::init(".").join_many(*mod_path_stack);
+        let mod_path = Path::new(".").join_many(*mod_path_stack);
         let dir_path = prefix.join(&mod_path);
         let file_path = match ::attr::first_attr_value_str_by_name(
                 outer_attrs, "path") {