Skip to content

Commit

Permalink
remove the code that encodes type parameter defs
Browse files Browse the repository at this point in the history
there are no type parameter defs in the relevant range
  • Loading branch information
arielb1 committed Oct 1, 2015
1 parent 8557cb4 commit db817ce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
4 changes: 1 addition & 3 deletions src/librustc/metadata/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ enum_from_u32! {
tag_table_node_type = 0x57,
tag_table_item_subst = 0x58,
tag_table_freevars = 0x59,
// GAP 0x5a
tag_table_param_defs = 0x5b,
// GAP 0x5c, 0x5d, 0x5e
// GAP 0x5a, 0x5b, 0x5c, 0x5d, 0x5e
tag_table_method_map = 0x5f,
// GAP 0x60
tag_table_adjustments = 0x61,
Expand Down
29 changes: 0 additions & 29 deletions src/librustc/middle/astencode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,6 @@ trait rbml_writer_helpers<'tcx> {
fn emit_region(&mut self, ecx: &e::EncodeContext, r: ty::Region);
fn emit_ty<'a>(&mut self, ecx: &e::EncodeContext<'a, 'tcx>, ty: Ty<'tcx>);
fn emit_tys<'a>(&mut self, ecx: &e::EncodeContext<'a, 'tcx>, tys: &[Ty<'tcx>]);
fn emit_type_param_def<'a>(&mut self, ecx: &e::EncodeContext<'a, 'tcx>,
type_param_def: &ty::TypeParameterDef<'tcx>);
fn emit_predicate<'a>(&mut self, ecx: &e::EncodeContext<'a, 'tcx>,
predicate: &ty::Predicate<'tcx>);
fn emit_trait_ref<'a>(&mut self, ecx: &e::EncodeContext<'a, 'tcx>,
Expand Down Expand Up @@ -657,15 +655,6 @@ impl<'a, 'tcx> rbml_writer_helpers<'tcx> for Encoder<'a> {
self.emit_opaque(|this| Ok(e::write_trait_ref(ecx, this, trait_ref)));
}

fn emit_type_param_def<'b>(&mut self, ecx: &e::EncodeContext<'b, 'tcx>,
type_param_def: &ty::TypeParameterDef<'tcx>) {
self.emit_opaque(|this| {
Ok(tyencode::enc_type_param_def(this,
&ecx.ty_str_ctxt(),
type_param_def))
});
}

fn emit_predicate<'b>(&mut self, ecx: &e::EncodeContext<'b, 'tcx>,
predicate: &ty::Predicate<'tcx>) {
self.emit_opaque(|this| {
Expand Down Expand Up @@ -894,13 +883,6 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
}
}

if let Some(type_param_def) = tcx.ty_param_defs.borrow().get(&id) {
rbml_w.tag(c::tag_table_param_defs, |rbml_w| {
rbml_w.id(id);
rbml_w.emit_type_param_def(ecx, type_param_def)
})
}

let method_call = ty::MethodCall::expr(id);
if let Some(method) = tcx.tables.borrow().method_map.get(&method_call) {
rbml_w.tag(c::tag_table_method_map, |rbml_w| {
Expand Down Expand Up @@ -985,8 +967,6 @@ trait rbml_decoder_decoder_helpers<'tcx> {
-> ty::TraitRef<'tcx>;
fn read_poly_trait_ref<'a, 'b>(&mut self, dcx: &DecodeContext<'a, 'b, 'tcx>)
-> ty::PolyTraitRef<'tcx>;
fn read_type_param_def<'a, 'b>(&mut self, dcx: &DecodeContext<'a, 'b, 'tcx>)
-> ty::TypeParameterDef<'tcx>;
fn read_predicate<'a, 'b>(&mut self, dcx: &DecodeContext<'a, 'b, 'tcx>)
-> ty::Predicate<'tcx>;
fn read_existential_bounds<'a, 'b>(&mut self, dcx: &DecodeContext<'a, 'b, 'tcx>)
Expand Down Expand Up @@ -1105,11 +1085,6 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
ty::Binder(self.read_ty_encoded(dcx, |decoder| decoder.parse_trait_ref()))
}

fn read_type_param_def<'b, 'c>(&mut self, dcx: &DecodeContext<'b, 'c, 'tcx>)
-> ty::TypeParameterDef<'tcx> {
self.read_ty_encoded(dcx, |decoder| decoder.parse_type_param_def())
}

fn read_predicate<'b, 'c>(&mut self, dcx: &DecodeContext<'b, 'c, 'tcx>)
-> ty::Predicate<'tcx>
{
Expand Down Expand Up @@ -1351,10 +1326,6 @@ fn decode_side_tables(dcx: &DecodeContext,
let ub = val_dsr.read_upvar_capture(dcx);
dcx.tcx.tables.borrow_mut().upvar_capture_map.insert(upvar_id, ub);
}
c::tag_table_param_defs => {
let bounds = val_dsr.read_type_param_def(dcx);
dcx.tcx.ty_param_defs.borrow_mut().insert(id, bounds);
}
c::tag_table_method_map => {
let (autoderef, method) = val_dsr.read_method_callee(dcx);
let method_call = ty::MethodCall {
Expand Down

0 comments on commit db817ce

Please sign in to comment.