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