rustc: Add legacy_records field to the type context

This commit is contained in:
Tim Chevalier 2013-01-25 22:58:24 -08:00
parent a72aeef9f7
commit db6af50d53
1 changed files with 8 additions and 1 deletions

View File

@ -418,6 +418,7 @@ type ctxt =
mut next_id: uint,
vecs_implicitly_copyable: bool,
legacy_modes: bool,
legacy_records: bool,
cstore: metadata::cstore::CStore,
sess: session::Session,
def_map: resolve::DefMap,
@ -984,11 +985,16 @@ fn mk_ctxt(s: session::Session,
+lang_items: middle::lang_items::LanguageItems,
crate: @ast::crate) -> ctxt {
let mut legacy_modes = false;
let mut legacy_records = false;
for crate.node.attrs.each |attribute| {
match attribute.node.value.node {
ast::meta_word(ref w) if (*w) == ~"legacy_modes" => {
legacy_modes = true;
break;
if legacy_records { break; }
}
ast::meta_word(ref w) if (*w) == ~"legacy_records" => {
legacy_records = true;
if legacy_modes { break; }
}
_ => {}
}
@ -1003,6 +1009,7 @@ fn mk_ctxt(s: session::Session,
mut next_id: 0u,
vecs_implicitly_copyable: vecs_implicitly_copyable,
legacy_modes: legacy_modes,
legacy_records: legacy_records,
cstore: s.cstore,
sess: s,
def_map: dm,