diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-11-22 15:45:12 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-11-29 10:55:13 -0800 |
| commit | c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b (patch) | |
| tree | 7b4e7af9dfe4342f3fd474f1010d4839281edd87 /src/libsyntax | |
| parent | 6c672ee094a1a8e72c100100f43c73a9741f08a7 (diff) | |
| download | rust-c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b.tar.gz rust-c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b.zip | |
libstd: Change `Path::new` to `Path::init`.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/source_util.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index c0c5c6c6c07..55f5490c8fb 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::new(file)), sp); + &res_rel_file(cx, sp, &Path::init(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::new(file)); + let file = res_rel_file(cx, sp, &Path::init(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::new(file)); + let file = res_rel_file(cx, sp, &Path::init(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::new(cx.codemap().span_to_filename(sp)); + let mut cu = Path::init(cx.codemap().span_to_filename(sp)); cu.pop(); cu.push(arg); cu diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 3e4a421cfba..8263906d925 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4216,10 +4216,10 @@ impl Parser { outer_attrs: &[ast::Attribute], id_sp: Span) -> (ast::item_, ~[ast::Attribute]) { - let mut prefix = Path::new(self.sess.cm.span_to_filename(*self.span)); + let mut prefix = Path::init(self.sess.cm.span_to_filename(*self.span)); prefix.pop(); let mod_path_stack = &*self.mod_path_stack; - let mod_path = Path::new(".").join_many(*mod_path_stack); + let mod_path = Path::init(".").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") { |
