auto merge of #6643 : sanxiyn/rust/legacy-modes, r=bstrie

This commit is contained in:
bors 2013-05-20 09:34:44 -07:00
commit 84233c0b4b
3 changed files with 3 additions and 16 deletions

View File

@ -239,7 +239,7 @@ pub fn compile_rest(sess: Session,
let (llmod, link_meta) = {
let ty_cx = ty::mk_ctxt(sess, def_map, ast_map, freevars,
region_map, rp_set, lang_items, crate);
region_map, rp_set, lang_items);
// passes are timed inside typeck
let (method_map, vtable_map) = typeck::check_crate(

View File

@ -232,7 +232,6 @@ struct ctxt_ {
diag: @syntax::diagnostic::span_handler,
interner: @mut HashMap<intern_key, ~t_box_>,
next_id: @mut uint,
legacy_modes: bool,
cstore: @mut metadata::cstore::CStore,
sess: session::Session,
def_map: resolve::DefMap,
@ -906,24 +905,12 @@ pub fn mk_ctxt(s: session::Session,
freevars: freevars::freevar_map,
region_maps: @mut middle::region::RegionMaps,
region_paramd_items: middle::region::region_paramd_items,
lang_items: middle::lang_items::LanguageItems,
crate: @ast::crate)
lang_items: middle::lang_items::LanguageItems)
-> ctxt {
let mut legacy_modes = false;
for crate.node.attrs.each |attribute| {
match attribute.node.value.node {
ast::meta_word(w) if *w == ~"legacy_modes" => {
legacy_modes = true;
}
_ => {}
}
}
@ctxt_ {
diag: s.diagnostic(),
interner: @mut HashMap::new(),
next_id: @mut primitives::LAST_PRIMITIVE_ID,
legacy_modes: legacy_modes,
cstore: s.cstore,
sess: s,
def_map: dm,

View File

@ -67,7 +67,7 @@ fn setup_env(test_name: &str, source_string: &str) -> Env {
cfg, parse_sess);
let tcx = ty::mk_ctxt(sess, dm, amap, freevars, region_map,
region_paramd_items, lang_items, crate);
region_paramd_items, lang_items);
let infcx = infer::new_infer_ctxt(tcx);