@@ -662,30 +662,6 @@ impl tr for MethodOrigin {
662
662
}
663
663
}
664
664
665
- // ______________________________________________________________________
666
- // Encoding and decoding vtable_res
667
-
668
- pub fn encode_vtable_res ( ecx : & e:: EncodeContext ,
669
- rbml_w : & mut Encoder ,
670
- dr : & typeck:: vtable_res ) {
671
- // can't autogenerate this code because automatic code of
672
- // ty::t doesn't work, and there is no way (atm) to have
673
- // hand-written encoding routines combine with auto-generated
674
- // ones. perhaps we should fix this.
675
- encode_vec_per_param_space (
676
- rbml_w, dr,
677
- |rbml_w, param_tables| encode_vtable_param_res ( ecx, rbml_w,
678
- param_tables) )
679
- }
680
-
681
- pub fn encode_vtable_param_res ( ecx : & e:: EncodeContext ,
682
- rbml_w : & mut Encoder ,
683
- param_tables : & typeck:: vtable_param_res ) {
684
- rbml_w. emit_from_vec ( param_tables. as_slice ( ) , |rbml_w, vtable_origin| {
685
- Ok ( encode_vtable_origin ( ecx, rbml_w, vtable_origin) )
686
- } ) . unwrap ( )
687
- }
688
-
689
665
pub fn encode_unboxed_closure_kind ( ebml_w : & mut Encoder ,
690
666
kind : ty:: UnboxedClosureKind ) {
691
667
use serialize:: Encoder ;
@@ -714,55 +690,6 @@ pub fn encode_unboxed_closure_kind(ebml_w: &mut Encoder,
714
690
} ) . unwrap ( )
715
691
}
716
692
717
- pub fn encode_vtable_origin ( ecx : & e:: EncodeContext ,
718
- rbml_w : & mut Encoder ,
719
- vtable_origin : & typeck:: vtable_origin ) {
720
- use serialize:: Encoder ;
721
-
722
- rbml_w. emit_enum ( "vtable_origin" , |rbml_w| {
723
- match * vtable_origin {
724
- typeck:: vtable_static( def_id, ref substs, ref vtable_res) => {
725
- rbml_w. emit_enum_variant ( "vtable_static" , 0 u, 3 u, |rbml_w| {
726
- rbml_w. emit_enum_variant_arg ( 0 u, |rbml_w| {
727
- Ok ( rbml_w. emit_def_id ( def_id) )
728
- } ) ;
729
- rbml_w. emit_enum_variant_arg ( 1 u, |rbml_w| {
730
- Ok ( rbml_w. emit_substs ( ecx, substs) )
731
- } ) ;
732
- rbml_w. emit_enum_variant_arg ( 2 u, |rbml_w| {
733
- Ok ( encode_vtable_res ( ecx, rbml_w, vtable_res) )
734
- } )
735
- } )
736
- }
737
- typeck:: vtable_param( pn, bn) => {
738
- rbml_w. emit_enum_variant ( "vtable_param" , 1 u, 3 u, |rbml_w| {
739
- rbml_w. emit_enum_variant_arg ( 0 u, |rbml_w| {
740
- pn. encode ( rbml_w)
741
- } ) ;
742
- rbml_w. emit_enum_variant_arg ( 1 u, |rbml_w| {
743
- rbml_w. emit_uint ( bn)
744
- } )
745
- } )
746
- }
747
- typeck:: vtable_unboxed_closure( def_id) => {
748
- rbml_w. emit_enum_variant ( "vtable_unboxed_closure" ,
749
- 2 u,
750
- 1 u,
751
- |rbml_w| {
752
- rbml_w. emit_enum_variant_arg ( 0 u, |rbml_w| {
753
- Ok ( rbml_w. emit_def_id ( def_id) )
754
- } )
755
- } )
756
- }
757
- typeck:: vtable_error => {
758
- rbml_w. emit_enum_variant ( "vtable_error" , 3 u, 3 u, |_rbml_w| {
759
- Ok ( ( ) )
760
- } )
761
- }
762
- }
763
- } ) . unwrap ( )
764
- }
765
-
766
693
pub trait vtable_decoder_helpers {
767
694
fn read_vec_per_param_space < T > ( & mut self ,
768
695
f: |& mut Self | -> T )
0 commit comments