@@ -514,6 +514,17 @@ impl tr for ty::BoundRegion {
514514 }
515515}
516516
517+ impl tr for ty:: TraitStore {
518+ fn tr ( & self , xcx : & ExtendedDecodeContext ) -> ty:: TraitStore {
519+ match * self {
520+ ty:: RegionTraitStore ( r, m) => {
521+ ty:: RegionTraitStore ( r. tr ( xcx) , m)
522+ }
523+ ty:: UniqTraitStore => ty:: UniqTraitStore
524+ }
525+ }
526+ }
527+
517528// ______________________________________________________________________
518529// Encoding and decoding of freevar information
519530
@@ -824,7 +835,6 @@ impl<'a> get_ty_str_ctxt for e::EncodeContext<'a> {
824835
825836trait ebml_writer_helpers {
826837 fn emit_ty ( & mut self , ecx : & e:: EncodeContext , ty : ty:: t ) ;
827- fn emit_vstore ( & mut self , ecx : & e:: EncodeContext , vstore : ty:: vstore ) ;
828838 fn emit_tys ( & mut self , ecx : & e:: EncodeContext , tys : & [ ty:: t ] ) ;
829839 fn emit_type_param_def ( & mut self ,
830840 ecx : & e:: EncodeContext ,
@@ -841,10 +851,6 @@ impl<'a> ebml_writer_helpers for Encoder<'a> {
841851 self . emit_opaque ( |this| Ok ( e:: write_type ( ecx, this, ty) ) ) ;
842852 }
843853
844- fn emit_vstore ( & mut self , ecx : & e:: EncodeContext , vstore : ty:: vstore ) {
845- self . emit_opaque ( |this| Ok ( e:: write_vstore ( ecx, this, vstore) ) ) ;
846- }
847-
848854 fn emit_tys ( & mut self , ecx : & e:: EncodeContext , tys : & [ ty:: t ] ) {
849855 self . emit_from_vec ( tys, |this, ty| Ok ( this. emit_ty ( ecx, * ty) ) ) ;
850856 }
@@ -904,14 +910,12 @@ impl<'a> ebml_writer_helpers for Encoder<'a> {
904910 } )
905911 }
906912
907- ty:: AutoObject ( sigil, region, m, b, def_id, ref substs) => {
908- this. emit_enum_variant ( "AutoObject" , 2 , 6 , |this| {
909- this. emit_enum_variant_arg ( 0 , |this| sigil. encode ( this) ) ;
910- this. emit_enum_variant_arg ( 1 , |this| region. encode ( this) ) ;
911- this. emit_enum_variant_arg ( 2 , |this| m. encode ( this) ) ;
912- this. emit_enum_variant_arg ( 3 , |this| b. encode ( this) ) ;
913- this. emit_enum_variant_arg ( 4 , |this| def_id. encode ( this) ) ;
914- this. emit_enum_variant_arg ( 5 , |this| Ok ( this. emit_substs ( ecx, substs) ) )
913+ ty:: AutoObject ( store, b, def_id, ref substs) => {
914+ this. emit_enum_variant ( "AutoObject" , 2 , 4 , |this| {
915+ this. emit_enum_variant_arg ( 0 , |this| store. encode ( this) ) ;
916+ this. emit_enum_variant_arg ( 1 , |this| b. encode ( this) ) ;
917+ this. emit_enum_variant_arg ( 2 , |this| def_id. encode ( this) ) ;
918+ this. emit_enum_variant_arg ( 3 , |this| Ok ( this. emit_substs ( ecx, substs) ) )
915919 } )
916920 }
917921 }
@@ -1280,25 +1284,16 @@ impl<'a> ebml_decoder_decoder_helpers for reader::Decoder<'a> {
12801284 ty:: AutoDerefRef ( auto_deref_ref. tr ( xcx) )
12811285 }
12821286 2 => {
1283- let sigil : ast :: Sigil =
1287+ let store : ty :: TraitStore =
12841288 this. read_enum_variant_arg ( 0 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
1285- let region: Option < ty:: Region > =
1286- this. read_enum_variant_arg ( 1 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
1287- let m: ast:: Mutability =
1288- this. read_enum_variant_arg ( 2 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
12891289 let b: ty:: BuiltinBounds =
1290- this. read_enum_variant_arg ( 3 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
1290+ this. read_enum_variant_arg ( 1 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
12911291 let def_id: ast:: DefId =
1292- this. read_enum_variant_arg ( 4 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
1293- let substs = this. read_enum_variant_arg ( 5 , |this| Ok ( this. read_substs ( xcx) ) )
1292+ this. read_enum_variant_arg ( 2 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
1293+ let substs = this. read_enum_variant_arg ( 3 , |this| Ok ( this. read_substs ( xcx) ) )
12941294 . unwrap ( ) ;
12951295
1296- let region = match region {
1297- Some ( r) => Some ( r. tr ( xcx) ) ,
1298- None => None
1299- } ;
1300-
1301- ty:: AutoObject ( sigil, region, m, b, def_id. tr ( xcx) , substs)
1296+ ty:: AutoObject ( store. tr ( xcx) , b, def_id. tr ( xcx) , substs)
13021297 }
13031298 _ => fail ! ( "bad enum variant for ty::AutoAdjustment" )
13041299 } )
0 commit comments