diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b8993520ae4cc..fe1787fca3cb0 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3550,8 +3550,7 @@ pub impl Parser { fn parse_item_mod(&self, outer_attrs: ~[ast::attribute]) -> item_info { let id_span = *self.span; let id = self.parse_ident(); - let merge = ::attr::first_attr_value_str_by_name(outer_attrs, "merge"); - let info_ = if *self.token == token::SEMI { + if *self.token == token::SEMI { self.bump(); // This mod is in an external file. Let's go get it! let (m, attrs) = self.eval_src_mod(id, outer_attrs, id_span); @@ -3564,38 +3563,6 @@ pub impl Parser { self.expect(&token::RBRACE); self.pop_mod_path(); (id, item_mod(m), Some(inner)) - }; - - // XXX: Transitionary hack to do the template work inside core - // (int-template, iter-trait). If there's a 'merge' attribute - // on the mod, then we'll go and suck in another file and merge - // its contents - match merge { - Some(path) => { - let prefix = Path( - self.sess.cm.span_to_filename(*self.span)); - let prefix = prefix.dir_path(); - let path = Path(copy *path); - let (new_mod_item, new_attrs) = self.eval_src_mod_from_path( - prefix, path, ~[], id_span); - - let (main_id, main_mod_item, main_attrs) = info_; - let main_attrs = main_attrs.get(); - - let (main_mod, new_mod) = - match (main_mod_item, new_mod_item) { - (item_mod(m), item_mod(n)) => (m, n), - _ => self.bug("parsed mod item should be mod") - }; - let merged_mod = ast::_mod { - view_items: main_mod.view_items + new_mod.view_items, - items: main_mod.items + new_mod.items - }; - - let merged_attrs = main_attrs + new_attrs; - (main_id, item_mod(merged_mod), Some(merged_attrs)) - } - None => info_ } } diff --git a/src/test/run-pass/mod-merge-hack-inst.rs b/src/test/run-pass/mod-merge-hack-inst.rs deleted file mode 100644 index 999c6ac2a71d5..0000000000000 --- a/src/test/run-pass/mod-merge-hack-inst.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// xfail-test not a test. used by mod-merge-hack.rs - -mod inst { - pub type T = i32; - pub static bits: uint = 32; -} diff --git a/src/test/run-pass/mod-merge-hack-template.rs b/src/test/run-pass/mod-merge-hack-template.rs deleted file mode 100644 index 7f7dd33dc099f..0000000000000 --- a/src/test/run-pass/mod-merge-hack-template.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// xfail-test not a test. used by mod-merge-hack.rs - -use T = self::inst::T; - -pub static bits: uint = inst::bits; -pub fn min(x: T, y: T) -> T { if x < y { x } else { y } } diff --git a/src/test/run-pass/mod-merge-hack.rs b/src/test/run-pass/mod-merge-hack.rs deleted file mode 100644 index fdef8c5b54102..0000000000000 --- a/src/test/run-pass/mod-merge-hack.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// xfail-pretty -#[path = "mod-merge-hack-template.rs"] -#[merge = "mod-merge-hack-inst.rs"] -mod myint32; - -pub fn main() { - assert_eq!(myint32::bits, 32); - assert_eq!(myint32::min(10, 20), 10); -}