@@ -514,6 +514,17 @@ impl tr for ty::BoundRegion {
514
514
}
515
515
}
516
516
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
+
517
528
// ______________________________________________________________________
518
529
// Encoding and decoding of freevar information
519
530
@@ -824,7 +835,6 @@ impl<'a> get_ty_str_ctxt for e::EncodeContext<'a> {
824
835
825
836
trait ebml_writer_helpers {
826
837
fn emit_ty ( & mut self , ecx : & e:: EncodeContext , ty : ty:: t ) ;
827
- fn emit_vstore ( & mut self , ecx : & e:: EncodeContext , vstore : ty:: vstore ) ;
828
838
fn emit_tys ( & mut self , ecx : & e:: EncodeContext , tys : & [ ty:: t ] ) ;
829
839
fn emit_type_param_def ( & mut self ,
830
840
ecx : & e:: EncodeContext ,
@@ -841,10 +851,6 @@ impl<'a> ebml_writer_helpers for Encoder<'a> {
841
851
self . emit_opaque ( |this| Ok ( e:: write_type ( ecx, this, ty) ) ) ;
842
852
}
843
853
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
-
848
854
fn emit_tys ( & mut self , ecx : & e:: EncodeContext , tys : & [ ty:: t ] ) {
849
855
self . emit_from_vec ( tys, |this, ty| Ok ( this. emit_ty ( ecx, * ty) ) ) ;
850
856
}
@@ -904,14 +910,12 @@ impl<'a> ebml_writer_helpers for Encoder<'a> {
904
910
} )
905
911
}
906
912
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) ) )
915
919
} )
916
920
}
917
921
}
@@ -1280,25 +1284,16 @@ impl<'a> ebml_decoder_decoder_helpers for reader::Decoder<'a> {
1280
1284
ty:: AutoDerefRef ( auto_deref_ref. tr ( xcx) )
1281
1285
}
1282
1286
2 => {
1283
- let sigil : ast :: Sigil =
1287
+ let store : ty :: TraitStore =
1284
1288
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 ( ) ;
1289
1289
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 ( ) ;
1291
1291
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) ) )
1294
1294
. unwrap ( ) ;
1295
1295
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)
1302
1297
}
1303
1298
_ => fail ! ( "bad enum variant for ty::AutoAdjustment" )
1304
1299
} )
0 commit comments