@@ -5,9 +5,8 @@ use std::ops::Range;
5
5
use std:: { hash, iter} ;
6
6
7
7
use 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 } ;
11
10
12
11
use super :: AllocRange ;
13
12
@@ -19,13 +18,13 @@ type Block = u64;
19
18
/// possible. Currently, if all the blocks have the same value, then the mask represents either a
20
19
/// fully initialized or fully uninitialized const allocation, so we can only store that single
21
20
/// value.
22
- #[ derive( Clone , Debug , Eq , PartialEq , TyEncodable , TyDecodable , Hash , HashStable ) ]
21
+ #[ derive( Clone , Debug , Eq , PartialEq , Encodable_NoContext , Decodable_NoContext , Hash , HashStable ) ]
23
22
pub struct InitMask {
24
23
blocks : InitMaskBlocks ,
25
24
len : Size ,
26
25
}
27
26
28
- #[ derive( Clone , Debug , Eq , PartialEq , TyEncodable , TyDecodable , Hash , HashStable ) ]
27
+ #[ derive( Clone , Debug , Eq , PartialEq , Encodable_NoContext , Decodable_NoContext , Hash , HashStable ) ]
29
28
enum InitMaskBlocks {
30
29
Lazy {
31
30
/// Whether the lazy init mask is fully initialized or uninitialized.
@@ -194,7 +193,7 @@ struct InitMaskMaterialized {
194
193
// and also produces more output when the high bits of each `u64` are occupied.
195
194
// Note: There is probably a remaining optimization for masks that do not use an entire
196
195
// `Block`.
197
- impl < E : TyEncoder > Encodable < E > for InitMaskMaterialized {
196
+ impl < E : Encoder > Encodable < E > for InitMaskMaterialized {
198
197
fn encode ( & self , encoder : & mut E ) {
199
198
encoder. emit_usize ( self . blocks . len ( ) ) ;
200
199
for block in & self . blocks {
@@ -204,7 +203,7 @@ impl<E: TyEncoder> Encodable<E> for InitMaskMaterialized {
204
203
}
205
204
206
205
// 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 {
208
207
fn decode ( decoder : & mut D ) -> Self {
209
208
let num_blocks = decoder. read_usize ( ) ;
210
209
let mut blocks = Vec :: with_capacity ( num_blocks) ;
0 commit comments