@@ -5,9 +5,8 @@ use std::ops::Range;
55use std:: { hash, iter} ;
66
77use rustc_abi:: Size ;
8- use rustc_macros:: { HashStable , TyDecodable , TyEncodable } ;
9- use rustc_serialize:: { Decodable , Encodable } ;
10- use rustc_type_ir:: { TyDecoder , TyEncoder } ;
8+ use rustc_macros:: { Decodable_NoContext , Encodable_NoContext , HashStable } ;
9+ use rustc_serialize:: { Decodable , Decoder , Encodable , Encoder } ;
1110
1211use super :: AllocRange ;
1312
@@ -19,13 +18,13 @@ type Block = u64;
1918/// possible. Currently, if all the blocks have the same value, then the mask represents either a
2019/// fully initialized or fully uninitialized const allocation, so we can only store that single
2120/// value.
22- #[ derive( Clone , Debug , Eq , PartialEq , TyEncodable , TyDecodable , Hash , HashStable ) ]
21+ #[ derive( Clone , Debug , Eq , PartialEq , Encodable_NoContext , Decodable_NoContext , Hash , HashStable ) ]
2322pub struct InitMask {
2423 blocks : InitMaskBlocks ,
2524 len : Size ,
2625}
2726
28- #[ derive( Clone , Debug , Eq , PartialEq , TyEncodable , TyDecodable , Hash , HashStable ) ]
27+ #[ derive( Clone , Debug , Eq , PartialEq , Encodable_NoContext , Decodable_NoContext , Hash , HashStable ) ]
2928enum InitMaskBlocks {
3029 Lazy {
3130 /// Whether the lazy init mask is fully initialized or uninitialized.
@@ -194,7 +193,7 @@ struct InitMaskMaterialized {
194193// and also produces more output when the high bits of each `u64` are occupied.
195194// Note: There is probably a remaining optimization for masks that do not use an entire
196195// `Block`.
197- impl < E : TyEncoder > Encodable < E > for InitMaskMaterialized {
196+ impl < E : Encoder > Encodable < E > for InitMaskMaterialized {
198197 fn encode ( & self , encoder : & mut E ) {
199198 encoder. emit_usize ( self . blocks . len ( ) ) ;
200199 for block in & self . blocks {
@@ -204,7 +203,7 @@ impl<E: TyEncoder> Encodable<E> for InitMaskMaterialized {
204203}
205204
206205// This implementation is deliberately not derived, see the matching `Encodable` impl.
207- impl < D : TyDecoder > Decodable < D > for InitMaskMaterialized {
206+ impl < D : Decoder > Decodable < D > for InitMaskMaterialized {
208207 fn decode ( decoder : & mut D ) -> Self {
209208 let num_blocks = decoder. read_usize ( ) ;
210209 let mut blocks = Vec :: with_capacity ( num_blocks) ;
0 commit comments