Make the path and path2 attributes equivalent. Remove some uses

This commit is contained in:
Brian Anderson 2012-12-17 18:06:52 -08:00
parent 5ff99c27d0
commit 33a8f855c2
7 changed files with 13 additions and 86 deletions

View file

@ -53,174 +53,121 @@ mod middle {
mod trans { mod trans {
#[legacy_exports]; #[legacy_exports];
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/inline.rs"]
mod inline; mod inline;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/monomorphize.rs"]
mod monomorphize; mod monomorphize;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/controlflow.rs"]
mod controlflow; mod controlflow;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/glue.rs"]
mod glue; mod glue;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/datum.rs"]
mod datum; mod datum;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/callee.rs"]
mod callee; mod callee;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/expr.rs"]
mod expr; mod expr;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/common.rs"]
mod common; mod common;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/consts.rs"]
mod consts; mod consts;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/type_of.rs"]
mod type_of; mod type_of;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/build.rs"]
mod build; mod build;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/base.rs"]
mod base; mod base;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/alt.rs"]
mod alt; mod alt;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/uniq.rs"]
mod uniq; mod uniq;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/closure.rs"]
mod closure; mod closure;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/tvec.rs"]
mod tvec; mod tvec;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/meth.rs"]
mod meth; mod meth;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/foreign.rs"]
mod foreign; mod foreign;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/reflect.rs"]
mod reflect; mod reflect;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/shape.rs"]
mod shape; mod shape;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/debuginfo.rs"]
mod debuginfo; mod debuginfo;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/type_use.rs"]
mod type_use; mod type_use;
#[legacy_exports] #[legacy_exports]
#[path = "middle/trans/reachable.rs"]
mod reachable; mod reachable;
#[path = "middle/trans/machine.rs"]
mod machine; mod machine;
} }
#[legacy_exports] #[legacy_exports]
#[path = "middle/ty.rs"]
mod ty; mod ty;
#[legacy_exports] #[legacy_exports]
#[path = "middle/resolve.rs"]
mod resolve; mod resolve;
#[path = "middle/typeck/mod.rs"] #[path2 = "typeck/mod.rs"]
pub mod typeck; pub mod typeck;
#[legacy_exports] #[legacy_exports]
#[path = "middle/check_loop.rs"]
mod check_loop; mod check_loop;
#[legacy_exports] #[legacy_exports]
#[path = "middle/check_alt.rs"]
mod check_alt; mod check_alt;
#[legacy_exports] #[legacy_exports]
#[path = "middle/check_const.rs"]
mod check_const; mod check_const;
#[legacy_exports] #[legacy_exports]
#[path = "middle/lint.rs"]
mod lint; mod lint;
#[path = "middle/borrowck/mod.rs"] #[path2 = "borrowck/mod.rs"]
pub mod borrowck; pub mod borrowck;
#[legacy_exports] #[legacy_exports]
#[path = "middle/mem_categorization.rs"]
mod mem_categorization; mod mem_categorization;
#[legacy_exports] #[legacy_exports]
#[path = "middle/liveness.rs"]
mod liveness; mod liveness;
#[legacy_exports] #[legacy_exports]
#[path = "middle/kind.rs"]
mod kind; mod kind;
#[legacy_exports] #[legacy_exports]
#[path = "middle/freevars.rs"]
mod freevars; mod freevars;
#[legacy_exports] #[legacy_exports]
#[path = "middle/capture.rs"]
mod capture; mod capture;
#[legacy_exports] #[legacy_exports]
#[path = "middle/pat_util.rs"]
mod pat_util; mod pat_util;
#[legacy_exports] #[legacy_exports]
#[path = "middle/region.rs"]
mod region; mod region;
#[legacy_exports] #[legacy_exports]
#[path = "middle/const_eval.rs"]
mod const_eval; mod const_eval;
#[legacy_exports] #[legacy_exports]
#[path = "middle/astencode.rs"]
mod astencode; mod astencode;
#[legacy_exports] #[legacy_exports]
#[path = "middle/lang_items.rs"]
mod lang_items; mod lang_items;
#[legacy_exports] #[legacy_exports]
#[path = "middle/privacy.rs"]
mod privacy; mod privacy;
#[path = "middle/mode.rs"]
mod mode; mod mode;
} }
mod front { mod front {
#[legacy_exports]; #[legacy_exports];
#[legacy_exports] #[legacy_exports]
#[path = "front/config.rs"]
mod config; mod config;
#[legacy_exports] #[legacy_exports]
#[path = "front/test.rs"]
mod test; mod test;
#[legacy_exports] #[legacy_exports]
#[path = "front/core_inject.rs"]
mod core_inject; mod core_inject;
#[legacy_exports] #[legacy_exports]
#[path = "front/intrinsic_inject.rs"]
mod intrinsic_inject; mod intrinsic_inject;
} }
mod back { mod back {
#[legacy_exports]; #[legacy_exports];
#[legacy_exports] #[legacy_exports]
#[path = "back/link.rs"]
mod link; mod link;
#[legacy_exports] #[legacy_exports]
#[path = "back/abi.rs"]
mod abi; mod abi;
#[legacy_exports] #[legacy_exports]
#[path = "back/upcall.rs"]
mod upcall; mod upcall;
#[legacy_exports] #[legacy_exports]
#[path = "back/x86.rs"]
mod x86; mod x86;
#[legacy_exports] #[legacy_exports]
#[path = "back/x86_64.rs"]
mod x86_64; mod x86_64;
#[legacy_exports] #[legacy_exports]
#[path = "back/rpath.rs"]
mod rpath; mod rpath;
#[legacy_exports] #[legacy_exports]
#[path = "back/target_strs.rs"]
mod target_strs; mod target_strs;
} }
@ -233,17 +180,14 @@ mod driver;
mod util { mod util {
#[legacy_exports]; #[legacy_exports];
#[legacy_exports] #[legacy_exports]
#[path = "util/common.rs"]
mod common; mod common;
#[legacy_exports] #[legacy_exports]
#[path = "util/ppaux.rs"]
mod ppaux; mod ppaux;
} }
mod lib { mod lib {
#[legacy_exports]; #[legacy_exports];
#[legacy_exports] #[legacy_exports]
#[path = "lib/llvm.rs"]
mod llvm; mod llvm;
} }

View file

@ -3018,7 +3018,7 @@ impl Parser {
fn push_mod_path(id: ident, attrs: ~[ast::attribute]) { fn push_mod_path(id: ident, attrs: ~[ast::attribute]) {
let default_path = self.sess.interner.get(id); let default_path = self.sess.interner.get(id);
let file_path = match ::attr::first_attr_value_str_by_name( let file_path = match ::attr::first_attr_value_str_by_name(
attrs, ~"path2") { attrs, ~"path") {
Some(ref d) => (*d), Some(ref d) => (*d),
None => copy *default_path None => copy *default_path
@ -3038,13 +3038,14 @@ impl Parser {
let prefix = prefix.dir_path(); let prefix = prefix.dir_path();
let mod_path = Path(".").push_many(self.mod_path_stack); let mod_path = Path(".").push_many(self.mod_path_stack);
let default_path = self.sess.interner.get(id) + ~".rs"; let default_path = self.sess.interner.get(id) + ~".rs";
// XXX path2 and path are synonyms. Remove path2 after snapshot
let file_path = match ::attr::first_attr_value_str_by_name( let file_path = match ::attr::first_attr_value_str_by_name(
outer_attrs, ~"path2") { outer_attrs, ~"path2") {
Some(ref d) => mod_path.push(*d), Some(ref d) => mod_path.push(*d),
None => match ::attr::first_attr_value_str_by_name( None => match ::attr::first_attr_value_str_by_name(
outer_attrs, ~"path") { outer_attrs, ~"path") {
Some(ref d) => Path(*d), Some(ref d) => mod_path.push(*d),
None => mod_path.push(default_path) None => mod_path.push(default_path)
} }
}; };

View file

@ -55,7 +55,7 @@ mod fold;
mod util { mod util {
#[legacy_exports]; #[legacy_exports];
#[legacy_exports] #[legacy_exports]
#[path = "util/interner.rs"] #[path2 = "interner.rs"]
mod interner; mod interner;
} }
@ -65,72 +65,54 @@ mod parse;
mod print { mod print {
#[legacy_exports]; #[legacy_exports];
#[legacy_exports] #[legacy_exports]
#[path = "print/pp.rs"]
mod pp; mod pp;
#[legacy_exports] #[legacy_exports]
#[path = "print/pprust.rs"]
mod pprust; mod pprust;
} }
mod ext { mod ext {
#[legacy_exports]; #[legacy_exports];
#[legacy_exports] #[legacy_exports]
#[path = "ext/base.rs"]
mod base; mod base;
#[legacy_exports] #[legacy_exports]
#[path = "ext/expand.rs"]
mod expand; mod expand;
#[path = "ext/quote.rs"]
mod quote; mod quote;
#[path = "ext/deriving.rs"]
mod deriving; mod deriving;
#[legacy_exports] #[legacy_exports]
#[path = "ext/build.rs"]
mod build; mod build;
mod tt { mod tt {
#[legacy_exports]; #[legacy_exports];
#[legacy_exports] #[legacy_exports]
#[path = "ext/tt/transcribe.rs"]
mod transcribe; mod transcribe;
#[legacy_exports] #[legacy_exports]
#[path = "ext/tt/macro_parser.rs"]
mod macro_parser; mod macro_parser;
#[legacy_exports] #[legacy_exports]
#[path = "ext/tt/macro_rules.rs"]
mod macro_rules; mod macro_rules;
} }
#[legacy_exports] #[legacy_exports]
#[path = "ext/fmt.rs"]
mod fmt; mod fmt;
#[legacy_exports] #[legacy_exports]
#[path = "ext/env.rs"]
mod env; mod env;
#[legacy_exports] #[legacy_exports]
#[path = "ext/concat_idents.rs"]
mod concat_idents; mod concat_idents;
#[legacy_exports] #[legacy_exports]
#[path = "ext/log_syntax.rs"]
mod log_syntax; mod log_syntax;
#[legacy_exports] #[legacy_exports]
#[path = "ext/auto_encode.rs"]
mod auto_encode; mod auto_encode;
#[legacy_exports] #[legacy_exports]
#[path = "ext/auto_serialize.rs"]
mod auto_serialize; mod auto_serialize;
#[legacy_exports] #[legacy_exports]
#[path = "ext/source_util.rs"]
mod source_util; mod source_util;
#[legacy_exports] #[legacy_exports]
#[path = "ext/pipes/mod.rs"] #[path2 = "pipes/mod.rs"]
mod pipes; mod pipes;
#[legacy_exports] #[legacy_exports]
#[path = "ext/trace_macros.rs"]
mod trace_macros; mod trace_macros;
} }

View file

@ -12,7 +12,7 @@
// xfail-fast // xfail-fast
mod mod_dir_simple { mod mod_dir_simple {
#[path2 = "test.rs"] #[path = "test.rs"]
pub mod syrup; pub mod syrup;
} }

View file

@ -11,9 +11,9 @@
// xfail-pretty // xfail-pretty
// xfail-fast // xfail-fast
#[path2 = "mod_dir_simple"] #[path = "mod_dir_simple"]
mod pancakes { mod pancakes {
#[path2 = "test.rs"] #[path = "test.rs"]
pub mod syrup; pub mod syrup;
} }

View file

@ -11,7 +11,7 @@
// xfail-pretty // xfail-pretty
// xfail-fast // xfail-fast
#[path2 = "mod_dir_simple"] #[path = "mod_dir_simple"]
mod pancakes { mod pancakes {
pub mod test; pub mod test;
} }

View file

@ -11,12 +11,12 @@
// xfail-pretty // xfail-pretty
// xfail-fast // xfail-fast
#[path2 = "mod_dir_simple"] #[path = "mod_dir_simple"]
mod biscuits { mod biscuits {
pub mod test; pub mod test;
} }
#[path2 = "mod_dir_simple"] #[path = "mod_dir_simple"]
mod gravy { mod gravy {
pub mod test; pub mod test;
} }