Remove ObjectCastMap

This commit is contained in:
Ariel Ben-Yehuda 2015-05-26 02:28:04 +03:00 committed by Ariel Ben-Yehuda
parent f4ee40ead2
commit 0ec3183df8
7 changed files with 7 additions and 53 deletions

View file

@ -146,7 +146,7 @@ enum_from_u32! {
tag_table_closure_kinds = 0x65,
tag_table_upvar_capture_map = 0x66,
tag_table_capture_modes = 0x67,
tag_table_object_cast_map = 0x68,
// GAP 0x68
tag_table_const_qualif = 0x69,
tag_table_cast_kinds = 0x6a,
}

View file

@ -1117,13 +1117,6 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
})
}
if let Some(trait_ref) = tcx.object_cast_map.borrow().get(&id) {
rbml_w.tag(c::tag_table_object_cast_map, |rbml_w| {
rbml_w.id(id);
rbml_w.emit_trait_ref(ecx, &trait_ref.0);
})
}
if let Some(adjustment) = tcx.adjustments.borrow().get(&id) {
match *adjustment {
ty::AdjustDerefRef(ref adj) => {
@ -1708,11 +1701,6 @@ fn decode_side_tables(dcx: &DecodeContext,
};
dcx.tcx.method_map.borrow_mut().insert(method_call, method);
}
c::tag_table_object_cast_map => {
let trait_ref = val_dsr.read_poly_trait_ref(dcx);
dcx.tcx.object_cast_map.borrow_mut()
.insert(id, trait_ref);
}
c::tag_table_adjustments => {
let adj: ty::AutoAdjustment = val_dsr.read_auto_adjustment(dcx);
dcx.tcx.adjustments.borrow_mut().insert(id, adj);

View file

@ -503,10 +503,6 @@ impl MethodCall {
// of the method to be invoked
pub type MethodMap<'tcx> = RefCell<FnvHashMap<MethodCall, MethodCallee<'tcx>>>;
// For every explicit cast into an object type, maps from the cast
// expr to the associated trait ref.
pub type ObjectCastMap<'tcx> = RefCell<NodeMap<ty::PolyTraitRef<'tcx>>>;
// Contains information needed to resolve types and (in the future) look up
// the types of AST nodes.
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
@ -557,8 +553,7 @@ pub struct CtxtArenas<'tcx> {
stability: TypedArena<attr::Stability>,
// references
trait_defs: TypedArena<TraitDef<'tcx>>
trait_defs: TypedArena<TraitDef<'tcx>>,
}
impl<'tcx> CtxtArenas<'tcx> {
@ -612,7 +607,6 @@ pub struct ctxt<'tcx> {
region_interner: RefCell<FnvHashMap<&'tcx Region, &'tcx Region>>,
stability_interner: RefCell<FnvHashMap<&'tcx attr::Stability, &'tcx attr::Stability>>,
/// Common types, pre-interned for your convenience.
pub types: CommonTypes<'tcx>,
@ -665,10 +659,6 @@ pub struct ctxt<'tcx> {
/// additional acyclicity requirements).
pub super_predicates: RefCell<DefIdMap<GenericPredicates<'tcx>>>,
/// Maps from node-id of a trait object cast (like `foo as
/// Box<Trait>`) to the trait reference.
pub object_cast_map: ObjectCastMap<'tcx>,
pub map: ast_map::Map<'tcx>,
pub freevars: RefCell<FreevarMap>,
pub tcache: RefCell<DefIdMap<TypeScheme<'tcx>>>,
@ -2742,7 +2732,6 @@ pub fn mk_ctxt<'tcx>(s: Session,
trait_defs: RefCell::new(DefIdMap()),
predicates: RefCell::new(DefIdMap()),
super_predicates: RefCell::new(DefIdMap()),
object_cast_map: RefCell::new(NodeMap()),
map: map,
freevars: freevars,
tcache: RefCell::new(DefIdMap()),