@@ -513,6 +513,17 @@ impl tr for ty::BoundRegion {
513513 }
514514}
515515
516+ impl tr for ty:: TraitStore {
517+ fn tr ( & self , xcx : & ExtendedDecodeContext ) -> ty:: TraitStore {
518+ match * self {
519+ ty:: RegionTraitStore ( r, m) => {
520+ ty:: RegionTraitStore ( r. tr ( xcx) , m)
521+ }
522+ ty:: UniqTraitStore => ty:: UniqTraitStore
523+ }
524+ }
525+ }
526+
516527// ______________________________________________________________________
517528// Encoding and decoding of freevar information
518529
@@ -823,7 +834,6 @@ impl<'a> get_ty_str_ctxt for e::EncodeContext<'a> {
823834
824835trait ebml_writer_helpers {
825836 fn emit_ty ( & mut self , ecx : & e:: EncodeContext , ty : ty:: t ) ;
826- fn emit_vstore ( & mut self , ecx : & e:: EncodeContext , vstore : ty:: Vstore ) ;
827837 fn emit_tys ( & mut self , ecx : & e:: EncodeContext , tys : & [ ty:: t ] ) ;
828838 fn emit_type_param_def ( & mut self ,
829839 ecx : & e:: EncodeContext ,
@@ -840,10 +850,6 @@ impl<'a> ebml_writer_helpers for Encoder<'a> {
840850 self . emit_opaque ( |this| Ok ( e:: write_type ( ecx, this, ty) ) ) ;
841851 }
842852
843- fn emit_vstore ( & mut self , ecx : & e:: EncodeContext , vstore : ty:: Vstore ) {
844- self . emit_opaque ( |this| Ok ( e:: write_vstore ( ecx, this, vstore) ) ) ;
845- }
846-
847853 fn emit_tys ( & mut self , ecx : & e:: EncodeContext , tys : & [ ty:: t ] ) {
848854 self . emit_from_vec ( tys, |this, ty| Ok ( this. emit_ty ( ecx, * ty) ) ) ;
849855 }
@@ -903,14 +909,12 @@ impl<'a> ebml_writer_helpers for Encoder<'a> {
903909 } )
904910 }
905911
906- ty:: AutoObject ( sigil, region, m, b, def_id, ref substs) => {
907- this. emit_enum_variant ( "AutoObject" , 2 , 6 , |this| {
908- this. emit_enum_variant_arg ( 0 , |this| sigil. encode ( this) ) ;
909- this. emit_enum_variant_arg ( 1 , |this| region. encode ( this) ) ;
910- this. emit_enum_variant_arg ( 2 , |this| m. encode ( this) ) ;
911- this. emit_enum_variant_arg ( 3 , |this| b. encode ( this) ) ;
912- this. emit_enum_variant_arg ( 4 , |this| def_id. encode ( this) ) ;
913- this. emit_enum_variant_arg ( 5 , |this| Ok ( this. emit_substs ( ecx, substs) ) )
912+ ty:: AutoObject ( store, b, def_id, ref substs) => {
913+ this. emit_enum_variant ( "AutoObject" , 2 , 4 , |this| {
914+ this. emit_enum_variant_arg ( 0 , |this| store. encode ( this) ) ;
915+ this. emit_enum_variant_arg ( 1 , |this| b. encode ( this) ) ;
916+ this. emit_enum_variant_arg ( 2 , |this| def_id. encode ( this) ) ;
917+ this. emit_enum_variant_arg ( 3 , |this| Ok ( this. emit_substs ( ecx, substs) ) )
914918 } )
915919 }
916920 }
@@ -1279,25 +1283,16 @@ impl<'a> ebml_decoder_decoder_helpers for reader::Decoder<'a> {
12791283 ty:: AutoDerefRef ( auto_deref_ref. tr ( xcx) )
12801284 }
12811285 2 => {
1282- let sigil : ast :: Sigil =
1286+ let store : ty :: TraitStore =
12831287 this. read_enum_variant_arg ( 0 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
1284- let region: Option < ty:: Region > =
1285- this. read_enum_variant_arg ( 1 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
1286- let m: ast:: Mutability =
1287- this. read_enum_variant_arg ( 2 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
12881288 let b: ty:: BuiltinBounds =
1289- this. read_enum_variant_arg ( 3 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
1289+ this. read_enum_variant_arg ( 1 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
12901290 let def_id: ast:: DefId =
1291- this. read_enum_variant_arg ( 4 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
1292- let substs = this. read_enum_variant_arg ( 5 , |this| Ok ( this. read_substs ( xcx) ) )
1291+ this. read_enum_variant_arg ( 2 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
1292+ let substs = this. read_enum_variant_arg ( 3 , |this| Ok ( this. read_substs ( xcx) ) )
12931293 . unwrap ( ) ;
12941294
1295- let region = match region {
1296- Some ( r) => Some ( r. tr ( xcx) ) ,
1297- None => None
1298- } ;
1299-
1300- ty:: AutoObject ( sigil, region, m, b, def_id. tr ( xcx) , substs)
1295+ ty:: AutoObject ( store. tr ( xcx) , b, def_id. tr ( xcx) , substs)
13011296 }
13021297 _ => fail ! ( "bad enum variant for ty::AutoAdjustment" )
13031298 } )
0 commit comments