Skip to content

Commit db6af50

Browse files
committed
rustc: Add legacy_records field to the type context
1 parent a72aeef commit db6af50

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/librustc/middle/ty.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ type ctxt =
418418
mut next_id: uint,
419419
vecs_implicitly_copyable: bool,
420420
legacy_modes: bool,
421+
legacy_records: bool,
421422
cstore: metadata::cstore::CStore,
422423
sess: session::Session,
423424
def_map: resolve::DefMap,
@@ -984,11 +985,16 @@ fn mk_ctxt(s: session::Session,
984985
+lang_items: middle::lang_items::LanguageItems,
985986
crate: @ast::crate) -> ctxt {
986987
let mut legacy_modes = false;
988+
let mut legacy_records = false;
987989
for crate.node.attrs.each |attribute| {
988990
match attribute.node.value.node {
989991
ast::meta_word(ref w) if (*w) == ~"legacy_modes" => {
990992
legacy_modes = true;
991-
break;
993+
if legacy_records { break; }
994+
}
995+
ast::meta_word(ref w) if (*w) == ~"legacy_records" => {
996+
legacy_records = true;
997+
if legacy_modes { break; }
992998
}
993999
_ => {}
9941000
}
@@ -1003,6 +1009,7 @@ fn mk_ctxt(s: session::Session,
10031009
mut next_id: 0u,
10041010
vecs_implicitly_copyable: vecs_implicitly_copyable,
10051011
legacy_modes: legacy_modes,
1012+
legacy_records: legacy_records,
10061013
cstore: s.cstore,
10071014
sess: s,
10081015
def_map: dm,

0 commit comments

Comments
 (0)