@@ -696,19 +696,6 @@ pub fn encode_cast_kind(ebml_w: &mut Encoder, kind: cast::CastKind) {
696
696
pub trait vtable_decoder_helpers < ' tcx > {
697
697
fn read_vec_per_param_space < T , F > ( & mut self , f : F ) -> VecPerParamSpace < T > where
698
698
F : FnMut ( & mut Self ) -> T ;
699
- fn read_vtable_res_with_key ( & mut self ,
700
- tcx : & ty:: ctxt < ' tcx > ,
701
- cdata : & cstore:: crate_metadata )
702
- -> ( u32 , ty:: vtable_res < ' tcx > ) ;
703
- fn read_vtable_res ( & mut self ,
704
- tcx : & ty:: ctxt < ' tcx > , cdata : & cstore:: crate_metadata )
705
- -> ty:: vtable_res < ' tcx > ;
706
- fn read_vtable_param_res ( & mut self ,
707
- tcx : & ty:: ctxt < ' tcx > , cdata : & cstore:: crate_metadata )
708
- -> ty:: vtable_param_res < ' tcx > ;
709
- fn read_vtable_origin ( & mut self ,
710
- tcx : & ty:: ctxt < ' tcx > , cdata : & cstore:: crate_metadata )
711
- -> ty:: vtable_origin < ' tcx > ;
712
699
}
713
700
714
701
impl < ' tcx , ' a > vtable_decoder_helpers < ' tcx > for reader:: Decoder < ' a > {
@@ -720,85 +707,6 @@ impl<'tcx, 'a> vtable_decoder_helpers<'tcx> for reader::Decoder<'a> {
720
707
let fns = self . read_to_vec ( |this| Ok ( f ( this) ) ) . unwrap ( ) ;
721
708
VecPerParamSpace :: new ( types, selfs, fns)
722
709
}
723
-
724
- fn read_vtable_res_with_key ( & mut self ,
725
- tcx : & ty:: ctxt < ' tcx > ,
726
- cdata : & cstore:: crate_metadata )
727
- -> ( u32 , ty:: vtable_res < ' tcx > ) {
728
- self . read_struct ( "VtableWithKey" , 2 , |this| {
729
- let autoderef = this. read_struct_field ( "autoderef" , 0 , |this| {
730
- Decodable :: decode ( this)
731
- } ) . unwrap ( ) ;
732
- Ok ( ( autoderef, this. read_struct_field ( "vtable_res" , 1 , |this| {
733
- Ok ( this. read_vtable_res ( tcx, cdata) )
734
- } ) . unwrap ( ) ) )
735
- } ) . unwrap ( )
736
- }
737
-
738
- fn read_vtable_res ( & mut self ,
739
- tcx : & ty:: ctxt < ' tcx > ,
740
- cdata : & cstore:: crate_metadata )
741
- -> ty:: vtable_res < ' tcx >
742
- {
743
- self . read_vec_per_param_space (
744
- |this| this. read_vtable_param_res ( tcx, cdata) )
745
- }
746
-
747
- fn read_vtable_param_res ( & mut self ,
748
- tcx : & ty:: ctxt < ' tcx > , cdata : & cstore:: crate_metadata )
749
- -> ty:: vtable_param_res < ' tcx > {
750
- self . read_to_vec ( |this| Ok ( this. read_vtable_origin ( tcx, cdata) ) )
751
- . unwrap ( ) . into_iter ( ) . collect ( )
752
- }
753
-
754
- fn read_vtable_origin ( & mut self ,
755
- tcx : & ty:: ctxt < ' tcx > , cdata : & cstore:: crate_metadata )
756
- -> ty:: vtable_origin < ' tcx > {
757
- self . read_enum ( "vtable_origin" , |this| {
758
- this. read_enum_variant ( & [ "vtable_static" ,
759
- "vtable_param" ,
760
- "vtable_error" ,
761
- "vtable_closure" ] ,
762
- |this, i| {
763
- Ok ( match i {
764
- 0 => {
765
- ty:: vtable_static (
766
- this. read_enum_variant_arg ( 0 , |this| {
767
- Ok ( this. read_def_id_nodcx ( cdata) )
768
- } ) . unwrap ( ) ,
769
- this. read_enum_variant_arg ( 1 , |this| {
770
- Ok ( this. read_substs_nodcx ( tcx, cdata) )
771
- } ) . unwrap ( ) ,
772
- this. read_enum_variant_arg ( 2 , |this| {
773
- Ok ( this. read_vtable_res ( tcx, cdata) )
774
- } ) . unwrap ( )
775
- )
776
- }
777
- 1 => {
778
- ty:: vtable_param (
779
- this. read_enum_variant_arg ( 0 , |this| {
780
- Decodable :: decode ( this)
781
- } ) . unwrap ( ) ,
782
- this. read_enum_variant_arg ( 1 , |this| {
783
- this. read_uint ( )
784
- } ) . unwrap ( )
785
- )
786
- }
787
- 2 => {
788
- ty:: vtable_closure (
789
- this. read_enum_variant_arg ( 0 , |this| {
790
- Ok ( this. read_def_id_nodcx ( cdata) )
791
- } ) . unwrap ( )
792
- )
793
- }
794
- 3 => {
795
- ty:: vtable_error
796
- }
797
- _ => panic ! ( "bad enum variant" )
798
- } )
799
- } )
800
- } ) . unwrap ( )
801
- }
802
710
}
803
711
804
712
// ___________________________________________________________________________
@@ -1209,13 +1117,6 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
1209
1117
} )
1210
1118
}
1211
1119
1212
- if let Some ( trait_ref) = tcx. object_cast_map . borrow ( ) . get ( & id) {
1213
- rbml_w. tag ( c:: tag_table_object_cast_map, |rbml_w| {
1214
- rbml_w. id ( id) ;
1215
- rbml_w. emit_trait_ref ( ecx, & trait_ref. 0 ) ;
1216
- } )
1217
- }
1218
-
1219
1120
if let Some ( adjustment) = tcx. adjustments . borrow ( ) . get ( & id) {
1220
1121
match * adjustment {
1221
1122
ty:: AdjustDerefRef ( ref adj) => {
@@ -1800,11 +1701,6 @@ fn decode_side_tables(dcx: &DecodeContext,
1800
1701
} ;
1801
1702
dcx. tcx . method_map . borrow_mut ( ) . insert ( method_call, method) ;
1802
1703
}
1803
- c:: tag_table_object_cast_map => {
1804
- let trait_ref = val_dsr. read_poly_trait_ref ( dcx) ;
1805
- dcx. tcx . object_cast_map . borrow_mut ( )
1806
- . insert ( id, trait_ref) ;
1807
- }
1808
1704
c:: tag_table_adjustments => {
1809
1705
let adj: ty:: AutoAdjustment = val_dsr. read_auto_adjustment ( dcx) ;
1810
1706
dcx. tcx . adjustments . borrow_mut ( ) . insert ( id, adj) ;
0 commit comments