rustc: Add a side table for legacy boxed traits, not filled in.
This is part of the transition to "@int as @Trait".
This commit is contained in:
parent
2df168812d
commit
4101d8c22d
@ -120,7 +120,8 @@ enum astencode_tag { // Reserves 0x50 -- 0x6f
|
||||
tag_table_spill = 0x5f,
|
||||
tag_table_method_map = 0x60,
|
||||
tag_table_vtable_map = 0x61,
|
||||
tag_table_adjustments = 0x62
|
||||
tag_table_adjustments = 0x62,
|
||||
tag_table_legacy_boxed_trait = 0x63
|
||||
}
|
||||
|
||||
type link_meta = {name: ~str, vers: ~str, extras_hash: ~str};
|
||||
|
@ -832,6 +832,12 @@ fn encode_side_tables_for_id(ecx: @e::encode_ctxt,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
do option::iter(&tcx.legacy_boxed_traits.find(id)) |_x| {
|
||||
do ebml_w.tag(c::tag_table_legacy_boxed_trait) {
|
||||
ebml_w.id(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
trait doc_decoder_helpers {
|
||||
@ -963,6 +969,8 @@ fn decode_side_tables(xcx: extended_decode_ctxt,
|
||||
} else if tag == (c::tag_table_adjustments as uint) {
|
||||
let adj = @ty::deserialize_AutoAdjustment(val_dsr).tr(xcx);
|
||||
dcx.tcx.adjustments.insert(id, adj);
|
||||
} else if tag == (c::tag_table_legacy_boxed_trait as uint) {
|
||||
dcx.tcx.legacy_boxed_traits.insert(id, ());
|
||||
} else {
|
||||
xcx.dcx.tcx.sess.bug(
|
||||
fmt!("unknown tag found in side tables: %x", tag));
|
||||
|
@ -356,7 +356,8 @@ type ctxt =
|
||||
inferred_modes: HashMap<ast::node_id, ast::mode>,
|
||||
adjustments: HashMap<ast::node_id, @AutoAdjustment>,
|
||||
normalized_cache: HashMap<t, t>,
|
||||
lang_items: middle::lang_items::LanguageItems};
|
||||
lang_items: middle::lang_items::LanguageItems,
|
||||
legacy_boxed_traits: HashMap<node_id, ()>};
|
||||
|
||||
enum tbox_flag {
|
||||
has_params = 1,
|
||||
@ -875,7 +876,8 @@ fn mk_ctxt(s: session::session,
|
||||
inferred_modes: HashMap(),
|
||||
adjustments: HashMap(),
|
||||
normalized_cache: new_ty_hash(),
|
||||
lang_items: move lang_items}
|
||||
lang_items: move lang_items,
|
||||
legacy_boxed_traits: HashMap()}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user